[GTK][WPE] Remove UpdateAtlas
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-03-28  Miguel Gomez  <magomez@igalia.com>
2
3         [GTK][WPE] Remove UpdateAtlas
4         https://bugs.webkit.org/show_bug.cgi?id=184042
5
6         Reviewed by Žan Doberšek.
7
8         Remove all the code related to UpdateAtlas handling.
9
10         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
11         (WebKit::CoordinatedGraphicsScene::updateTilesIfNeeded):
12         (WebKit::CoordinatedGraphicsScene::commitSceneState):
13         (WebKit::CoordinatedGraphicsScene::purgeGLResources):
14         (WebKit::CoordinatedGraphicsScene::syncUpdateAtlases): Deleted.
15         (WebKit::CoordinatedGraphicsScene::createUpdateAtlas): Deleted.
16         (WebKit::CoordinatedGraphicsScene::removeUpdateAtlas): Deleted.
17         (WebKit::CoordinatedGraphicsScene::releaseUpdateAtlases): Deleted.
18         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
19         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
20         (WebKit::ThreadedCompositor::renderLayerTree):
21         (WebKit::ThreadedCompositor::releaseUpdateAtlases): Deleted.
22         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
23         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
24         (WebKit::WebChromeClient::delegatedScrollRequested):
25         (WebKit::WebChromeClient::resetUpdateAtlasForTesting): Deleted.
26         * WebProcess/WebCoreSupport/WebChromeClient.h:
27         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
28         (WebKit::AcceleratedDrawingArea::resetUpdateAtlasForTesting): Deleted.
29         * WebProcess/WebPage/AcceleratedDrawingArea.h:
30         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
31         (WebKit::CompositingCoordinator::CompositingCoordinator):
32         (WebKit::CompositingCoordinator::flushPendingLayerChanges):
33         (WebKit::CompositingCoordinator::clearPendingStateChanges):
34         (WebKit::CompositingCoordinator::renderNextFrame):
35         (WebKit::CompositingCoordinator::purgeBackingStores):
36         (WebKit::CompositingCoordinator::createUpdateAtlas): Deleted.
37         (WebKit::CompositingCoordinator::removeUpdateAtlas): Deleted.
38         (WebKit::CompositingCoordinator::getCoordinatedBuffer): Deleted.
39         (): Deleted.
40         (WebKit::CompositingCoordinator::scheduleReleaseInactiveAtlases): Deleted.
41         (WebKit::CompositingCoordinator::releaseInactiveAtlasesTimerFired): Deleted.
42         (WebKit::CompositingCoordinator::releaseAtlases): Deleted.
43         (WebKit::CompositingCoordinator::clearUpdateAtlases): Deleted.
44         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
45         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
46         (WebKit::CoordinatedLayerTreeHost::clearUpdateAtlases): Deleted.
47         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
48         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
49         (WebKit::ThreadedCoordinatedLayerTreeHost::releaseUpdateAtlases): Deleted.
50         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
51         * WebProcess/WebPage/DrawingArea.h:
52         * WebProcess/WebPage/LayerTreeHost.h:
53         (WebKit::LayerTreeHost::setIsDiscardable):
54
55 2018-03-28  Carlos Garcia Campos  <cgarcia@igalia.com>
56
57         REGRESSION(r229998): WebDriver: MiniBrowser is crashing in a lot of tests after r229998
58         https://bugs.webkit.org/show_bug.cgi?id=184075
59
60         Reviewed by Žan Doberšek.
61
62         This is because we are using a value after it has been moved.
63
64         * UIProcess/Automation/WebAutomationSession.cpp:
65         (WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext): Save a reference to page in a local variable
66         before using it when it's also going to be moved in the lambda capture.
67
68 2018-03-27  Michael Catanzaro  <mcatanzaro@igalia.com>
69
70         Unreviewed, fix typo in variable name
71
72         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
73         (webkitWebViewBaseCrossingNotifyEvent):
74
75 2018-03-27  Per Arne Vollan  <pvollan@apple.com>
76
77         The layout test fast/canvas/webgl/read-pixels-test.html is timing out.
78         https://bugs.webkit.org/show_bug.cgi?id=183923
79         <rdar://problem/38756869>
80
81         Reviewed by Brent Fulgham.
82
83         Send OpenGL display mask to the WebContent process when the display ID is changing.
84
85         * UIProcess/WebPageProxy.cpp:
86         (WebKit::WebPageProxy::windowScreenDidChange):
87         * WebProcess/WebPage/WebPage.h:
88         * WebProcess/WebPage/WebPage.messages.in:
89         * WebProcess/WebPage/mac/WebPageMac.mm:
90         (WebKit::WebPage::openGLDisplayMaskChanged):
91
92 2018-03-27  Youenn Fablet  <youenn@apple.com>
93
94         Move request checking out of PingLoad for future reuse in NetworkLoad
95         https://bugs.webkit.org/show_bug.cgi?id=183865
96
97         Reviewed by Chris Dumez.
98
99         Introduce NetworkLoadChecker as a way to validate requests before sending them in the network process.
100         Validation encompasses: CORS checks, CSP and Content Extensions on both main request and redirected requests if any.
101
102         Make PingLoad use NetworkLoadChecker. Future patch should make NetworkLoad to use it as well whenever needed.
103
104         Make NetworkCORSPreflightChecker takes a CompletionHandler instead of a Function.
105         Ensure this callback is called even if preflight is not completed by returning a Canceled error.
106
107         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
108         (WebKit::NetworkCORSPreflightChecker::~NetworkCORSPreflightChecker):
109         (WebKit::NetworkCORSPreflightChecker::returnResult):
110         (WebKit::NetworkCORSPreflightChecker::willPerformHTTPRedirection):
111         (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
112         (WebKit::NetworkCORSPreflightChecker::didCompleteWithError):
113         * NetworkProcess/NetworkCORSPreflightChecker.h:
114         * NetworkProcess/NetworkLoadChecker.cpp: Added.
115         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
116         (WebKit::NetworkLoadChecker::check):
117         (WebKit::NetworkLoadChecker::checkRedirection):
118         (WebKit::NetworkLoadChecker::returnError):
119         (WebKit::NetworkLoadChecker::checkRequest):
120         (WebKit::NetworkLoadChecker::checkCORSRequest):
121         (WebKit::NetworkLoadChecker::checkCORSRedirectedRequest):
122         (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
123         (WebKit::NetworkLoadChecker::doesNotNeedCORSCheck const):
124         (WebKit::NetworkLoadChecker::contentSecurityPolicy const):
125         (WebKit::NetworkLoadChecker::contentExtensionsBackend):
126         (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
127         * NetworkProcess/NetworkLoadChecker.h: Added.
128         (WebKit::NetworkLoadChecker::setCSPResponseHeaders):
129         (WebKit::NetworkLoadChecker::setContentExtensionRuleLists):
130         (WebKit::NetworkLoadChecker::url const):
131         (WebKit::NetworkLoadChecker::storedCredentialsPolicy const):
132         (WebKit::NetworkLoadChecker::isChecking const):
133         (WebKit::NetworkLoadChecker::isRedirected const):
134         * NetworkProcess/PingLoad.cpp:
135         (WebKit::PingLoad::PingLoad):
136         (WebKit::PingLoad::~PingLoad):
137         (WebKit::PingLoad::willPerformHTTPRedirection):
138         (WebKit::PingLoad::didReceiveChallenge):
139         (WebKit::PingLoad::wasBlocked):
140         (WebKit::PingLoad::cannotShowURL):
141         (WebKit::PingLoad::timeoutTimerFired):
142         (WebKit::PingLoad::currentURL const):
143         * NetworkProcess/PingLoad.h:
144         * WebKit.xcodeproj/project.pbxproj:
145
146 2018-03-27  Jiewen Tan  <jiewen_tan@apple.com>
147
148         [WebAuthN] Implement authenticatorGetAssertion
149         https://bugs.webkit.org/show_bug.cgi?id=183881
150         <rdar://problem/37258628>
151
152         Reviewed by Brent Fulgham.
153
154         * Shared/WebPreferences.yaml:
155         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp:
156         (WebKit::WebCredentialsMessengerProxy::makeCredential):
157         (WebKit::WebCredentialsMessengerProxy::getAssertion):
158         (WebKit::WebCredentialsMessengerProxy::getAssertionReply):
159         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h:
160         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in:
161         * WebProcess/CredentialManagement/WebCredentialsMessenger.cpp:
162         (WebKit::WebCredentialsMessenger::getAssertion):
163         (WebKit::WebCredentialsMessenger::getAssertionReply):
164         * WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in:
165
166 2018-03-27  Chris Dumez  <cdumez@apple.com>
167
168         Avoid constructing SecurityOrigin objects from non-main threads
169         https://bugs.webkit.org/show_bug.cgi?id=184024
170
171         Reviewed by Youenn Fablet.
172
173         Avoid constructing SecurityOrigin objects from non-main threads as much as possible.
174
175         * WebProcess/Storage/WebSWClientConnection.cpp:
176         (WebKit::WebSWClientConnection::mayHaveServiceWorkerRegisteredForOrigin const):
177         (WebKit::WebSWClientConnection::matchRegistration):
178         (WebKit::WebSWClientConnection::getRegistrations):
179         * WebProcess/Storage/WebSWClientConnection.h:
180         * WebProcess/Storage/WebSWOriginTable.cpp:
181         (WebKit::WebSWOriginTable::contains const):
182         * WebProcess/Storage/WebSWOriginTable.h:
183
184 2018-03-27  Chris Dumez  <cdumez@apple.com>
185
186         Move online state detection from the WebProcess to the NetworkProcess
187         https://bugs.webkit.org/show_bug.cgi?id=183989
188         <rdar://problem/37093299>
189
190         Reviewed by Youenn Fablet.
191
192         Move online state detection from the WebProcess to the NetworkProcess. This avoid executing the same (expensive) code in
193         EACH web process whenever a network interface's state changes. Now, the Network Process monitors network interfaces
194         and determines the online state whenever an interface's state changes. If the onLine state changes, it notifies all
195         its connected WebProcesses via IPC.
196
197         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
198         (WebKit::NetworkConnectionToWebProcess::setOnLineState):
199         * NetworkProcess/NetworkConnectionToWebProcess.h:
200         * NetworkProcess/NetworkProcess.cpp:
201         (WebKit::NetworkProcess::NetworkProcess):
202         (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
203         * WebProcess/Network/NetworkProcessConnection.cpp:
204         (WebKit::NetworkProcessConnection::setOnLineState):
205         * WebProcess/Network/NetworkProcessConnection.h:
206         * WebProcess/Network/NetworkProcessConnection.messages.in:
207         * WebProcess/Network/WebLoaderStrategy.cpp:
208         (WebKit::WebLoaderStrategy::isOnLine const):
209         (WebKit::WebLoaderStrategy::addOnlineStateChangeListener):
210         (WebKit::WebLoaderStrategy::setOnLineState):
211         * WebProcess/Network/WebLoaderStrategy.h:
212
213 2018-03-27  Wenson Hsieh  <wenson_hsieh@apple.com>
214
215         [Extra zoom mode] Add support for new focused form control overlay behaviors
216         https://bugs.webkit.org/show_bug.cgi?id=184043
217         <rdar://problem/38758727>
218
219         Reviewed by Tim Horton.
220
221         See below for more details.
222
223         * UIProcess/ios/WKContentViewInteraction.mm:
224         (-[WKContentView _willStartScrollingOrZooming]):
225         (-[WKContentView _didEndScrollingOrZooming]):
226
227         Suppress focused form control navigation while the scroll view is undergoing a scroll or zoom animation (e.g.,
228         when moving from one focused form control to another).
229
230         (-[WKContentView textInputController:didCommitText:withSuggestion:]):
231
232         When dismissing an input view controller, allow focused form control navigation only after updating assisted
233         node information to ensure that focus rects aren't stale as the user begins to navigate between forms.
234
235         (-[WKContentView rectForFocusedFormControlController:inCoordinateSpace:]):
236         (-[WKContentView nextRectForFocusedFormControlController:inCoordinateSpace:]):
237         (-[WKContentView previousRectForFocusedFormControlController:inCoordinateSpace:]):
238         (-[WKContentView scrollViewForFocusedFormControlController:]):
239         (-[WKContentView highlightedRectForFocusedFormControlController:inCoordinateSpace:]): Deleted.
240
241         Implement some new focused form overlay delegate hooks to vend the scroll view, as well as the rects of next and
242         previous focusable form controls.
243
244 2018-03-27  Brent Fulgham  <bfulgham@apple.com>
245
246         Further refine cookie read/write logging
247         https://bugs.webkit.org/show_bug.cgi?id=184044
248         <rdar://problem/38915610>
249
250         Reviewed by Chris Dumez.
251
252         Cookie logging was passing the partition, rather than the first party, when logging, which
253         prevented logging in cases where partitioning or blocking was active. This patch corrects
254         these calls so that logging is generated in these cases, too.
255
256         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
257         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM): Call log routines if needed.
258         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM): Ditto.
259         * NetworkProcess/NetworkResourceLoader.cpp:
260         (WebKit::escapeIDForJSON): Make available to use in multiple functions.
261         (WebKit::NetworkResourceLoader::logCookieInformation const): Revise to use shared
262         convenience functions.
263         (WebKit::logBlockedCookieInformation): Added.
264         (WebKit::logCookieInformationInternal): Added.
265         (WebKit::NetworkResourceLoader::logCookieInformation): Revise to use shared
266         convenience functions.
267         * NetworkProcess/NetworkResourceLoader.h:
268
269 2018-03-27  Brian Burg  <bburg@apple.com>
270
271         Web Automation: support enter/exit fullscreen and hide/restore window operations
272         https://bugs.webkit.org/show_bug.cgi?id=182837
273         <rdar://problem/37580732>
274
275         Reviewed by Tim Horton.
276
277         The W3C specification is more explicit about when to exit fullscreen and
278         restore the window for a browsing context. So, WebKit needs to have support
279         for performing these operations on behalf of a driver.
280
281         Based on prototyping, it is sufficient to use a JavaScript atom to enter
282         fullscreen mode. This is included in the patch as EnterFullscreen.js and
283         can be used to implement the §10.7.5 Fullscreen Window command.
284
285         Other window operations cannot be peformed from JavaScript, so we need to
286         delegate these operations to the session client (i.e., Safari).
287         This patch adds session client callouts for restoring, minimizing, and
288         switching to a browsing context.
289
290         Exiting fullscreen happens implicitly (per specification) when setting a
291         window frame without an actual frame, or when switching/restoring/minimizing a window.
292         If needed, a driver can call Set Window Rect in this way to unfullscreen a context.
293         Similarly, a driver can restore a minimized window using Set Window Rect.
294
295         * UIProcess/API/APIAutomationSessionClient.h:
296         (API::AutomationSessionClient::requestHideWindowOfPage):
297         (API::AutomationSessionClient::requestRestoreWindowOfPage):
298         (API::AutomationSessionClient::requestSwitchToPage):
299         Add new API client methods.
300
301         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
302         Add new Cocoa API delegate methods.
303
304         * UIProcess/Automation/Automation.json:
305         Make the switch to browsing context command asynchronous, since this functionality
306         is not always synchronous, and we prefer to use completion handlers in the delegates.
307
308         Add new protocol method for hiding the window of a browsing context.
309         This is expected to minimize/miniaturize a window for desktop window managers.
310
311         * UIProcess/Automation/WebAutomationSession.h:
312         * UIProcess/Automation/WebAutomationSession.cpp:
313         (WebKit::WebAutomationSession::switchToBrowsingContext):
314         Make this function asynchronous. Call out to the session client.
315
316         (WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext):
317         Follow the steps in the specification to restore window and exit fullscreen.
318
319         (WebKit::WebAutomationSession::hideWindowOfBrowsingContext):
320         Exit fullscreen and call out to the session client.
321
322         (WebKit::WebAutomationSession::exitFullscreenWindowForPage):
323         This is a little strange. Because there is no async API for exiting fullscreen
324         from C++ code, we hook into willEnterFullScreen and didExitFullScreen and send
325         out the response if the page exited fullscreen after we requested it to do so.
326         Because the W3C specification mandates that drivers only process one command at
327         a time, there will only ever be one callback installed by this method at a time.
328
329         (WebKit::WebAutomationSession::restoreWindowForPage):
330         (WebKit::WebAutomationSession::hideWindowForPage):
331         Call out to the session client.
332
333         (WebKit::WebAutomationSession::didEnterFullScreenForPage):
334         (WebKit::WebAutomationSession::didExitFullScreenForPage):
335         Add methods to be called by instrumentation hooks in WebFullScreenManagerProxy.
336
337         * UIProcess/Automation/atoms/EnterFullscreen.js: Added.
338         (enterFullscreen):
339
340         * UIProcess/Cocoa/AutomationSessionClient.h:
341         * UIProcess/Cocoa/AutomationSessionClient.mm:
342         (WebKit::AutomationSessionClient::AutomationSessionClient):
343         (WebKit::AutomationSessionClient::requestSwitchToPage):
344         (WebKit::AutomationSessionClient::requestHideWindowOfPage):
345         (WebKit::AutomationSessionClient::requestRestoreWindowOfPage):
346         (WebKit::AutomationSessionClient::isShowingJavaScriptDialogOnPage):
347         Add boilerplate to convert C++ API client to Objective-C delegate methods.
348
349         * UIProcess/WebFullScreenManagerProxy.cpp:
350         (WebKit::WebFullScreenManagerProxy::didEnterFullScreen):
351         (WebKit::WebFullScreenManagerProxy::didExitFullScreen):
352         Notify the automation session if the page is under automation and
353         enters or exits fullscreen.
354
355         * WebKit.xcodeproj/project.pbxproj:
356         Add EnterFullscreen.js to the list of WebDriver atoms. These are copied
357         as WebKit2 private headers and used by driver implementations.
358
359 2018-03-27  Eric Carlson  <eric.carlson@apple.com>
360
361         Make AVFoundationEnabled preference available on iOS
362         https://bugs.webkit.org/show_bug.cgi?id=183876
363         <rdar://problem/38726459>
364
365         Reviewed by Youenn Fablet.
366
367         * Shared/WebPreferences.yaml: Set AVFoundationEnabled with DEFAULT_AVFOUNDATION_ENABLED.
368         * Shared/WebPreferencesDefaultValues.h:
369
370         * UIProcess/API/Cocoa/WKPreferences.mm:
371         (-[WKPreferences _setAVFoundationEnabled:]): Enable for iOS.
372         (-[WKPreferences _avFoundationEnabled]): Ditto.
373         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
374
375 2018-03-26  Tim Horton  <timothy_horton@apple.com>
376
377         Adopt WK_ALTERNATE_FRAMEWORKS_DIR in WebKit
378         https://bugs.webkit.org/show_bug.cgi?id=184030
379         <rdar://problem/38895281>
380
381         Reviewed by Dan Bernstein.
382
383         * Configurations/Base.xcconfig:
384         * Configurations/BaseTarget.xcconfig:
385         * Configurations/WebKit.xcconfig:
386
387 2018-03-26  Tim Horton  <timothy_horton@apple.com>
388
389         Add and adopt HAVE(CORE_ANIMATION_RENDER_SERVER)
390         https://bugs.webkit.org/show_bug.cgi?id=184026
391         <rdar://problem/38883321>
392
393         Reviewed by Sam Weinig.
394
395         * UIProcess/API/Cocoa/WKWebView.mm:
396         (-[WKWebView _takeViewSnapshot]):
397         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
398
399 2018-03-26  Wenson Hsieh  <wenson_hsieh@apple.com>
400
401         [Extra zoom mode] Refactor input view controller presentation and dismissal helpers
402         https://bugs.webkit.org/show_bug.cgi?id=184020
403         Work towards <rdar://problem/38758727>
404
405         Reviewed by Tim Horton.
406
407         We currently have separate presentation and dismissal helpers for each type of view controller corresponding to
408         a focused element type. This is excessive, considering that all of these helpers are only invoked from one place
409         (either -presentViewControllerForCurrentAssistedNode or -dismissAllInputViewControllers), with the exception of
410         the focused form control overlay.
411
412         This refactoring allows us to then adjust the timing of first responder restoration logic, such that the focused
413         form control view controller can receive forwarded events from the web view. See below for more detail.
414
415         * UIProcess/ios/WKContentViewInteraction.mm:
416         (-[WKContentView presentFocusedFormControlViewController:]):
417         (-[WKContentView dismissFocusedFormControlViewController:]):
418
419         Remove logic to restore the web view as first responder.
420
421         (-[WKContentView presentViewControllerForCurrentAssistedNode]):
422         (-[WKContentView dismissAllInputViewControllers]):
423
424         Restore first responder after dismissing a view controller that was presented when focusing a form control, only
425         if the web view was first responder before presentation.
426
427         (-[WKContentView presentDatePickerViewController:]): Deleted.
428         (-[WKContentView dismissDatePickerViewController:]): Deleted.
429         (-[WKContentView presentTimePickerViewController:]): Deleted.
430         (-[WKContentView dismissTimePickerViewController:]): Deleted.
431         (-[WKContentView presentSelectMenuViewController:]): Deleted.
432         (-[WKContentView dismissSelectMenuViewController:]): Deleted.
433         (-[WKContentView dismissNumberPadViewController:]): Deleted.
434         (-[WKContentView presentNumberPadViewController:]): Deleted.
435         (-[WKContentView presentTextInputViewController:]): Deleted.
436         (-[WKContentView dismissTextInputViewController:]): Deleted.
437
438 2018-03-06  Brian Burg  <bburg@apple.com>
439
440         Web Automation: provide a way to ask clients for a new tab or window
441         https://bugs.webkit.org/show_bug.cgi?id=183381
442         <rdar://problem/38167301>
443
444         Reviewed by Timothy Hatcher.
445
446         Add support for specifying browsing context options when requesting
447         a new browsing context from the automation session client/delegate.
448         This is currently just used for specifying tab vs window, but could
449         also be used for things like toggling certain browser chrome or features.
450
451         There is no guarantee that the client has a notion of tabs vs windows,
452         so this option is purely advisory and should not cause the command to
453         fail if it cannot be honored.
454
455         This behavior caused by specifying this option is client-specific, so no
456         new tests are included in WebKit for this change.
457
458         * UIProcess/API/APIAutomationSessionClient.h:
459         (API::AutomationSessionClient::didRequestNewPageWithOptions):
460         (API::AutomationSessionClient::didRequestNewWindow): Deleted.
461         Add options parameter.
462
463         * UIProcess/API/glib/WebKitAutomationSession.cpp:
464         Adjust to new signature. More work is needed to plumb this information
465         to the public API for GTK/WPE and support it in WebKitGTK driver.
466
467         * UIProcess/Automation/Automation.json: Add new optional parameter.
468
469         * UIProcess/Automation/WebAutomationSession.h:
470         * UIProcess/Automation/WebAutomationSession.cpp:
471         (WebKit::WebAutomationSession::createBrowsingContext):
472         Convert the protocol option to an API option.
473
474         * UIProcess/Cocoa/AutomationSessionClient.h:
475         * UIProcess/Cocoa/AutomationSessionClient.mm:
476         (WebKit::AutomationSessionClient::AutomationSessionClient):
477         (WebKit::toAPI):
478         (WebKit::AutomationSessionClient::didRequestNewPageWithOptions):
479         (WebKit::AutomationSessionClient::didRequestNewWindow): Deleted.
480         Convert the internal option to a Cocoa SPI option and pass it along.
481
482         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
483         Adjust delegate methods to include options. Clients need to adopt the new signature(s).
484
485 2018-03-26  Wenson Hsieh  <wenson_hsieh@apple.com>
486
487         [Extra zoom mode] Add plumbing for next and previous focusable element rects
488         https://bugs.webkit.org/show_bug.cgi?id=184016
489         Work towards <rdar://problem/38758727>
490
491         Reviewed by Tim Horton.
492
493         When building up AssistedNodeInformation, we currently compute the element rect of the current focused element,
494         as well as flags indicating whether or not there are next or previous focusable elements. For
495         <rdar://problem/38758727>, we additionally send the rects of the next or previous focusable elements as well.
496
497         * Shared/AssistedNodeInformation.cpp:
498         (WebKit::AssistedNodeInformation::encode const):
499         (WebKit::AssistedNodeInformation::decode):
500
501         IPC support for nextNodeRect and previousNodeRect.
502
503         * Shared/AssistedNodeInformation.h:
504         * WebProcess/WebPage/ios/WebPageIOS.mm:
505         (WebKit::elementRectInRootViewCoordinates):
506
507         Add a helper to compute an element's rect in root view coordinates. We use this to compute the rects of the
508         current focused element as well as those of the next and previous elements, if any.
509
510         (WebKit::WebPage::getAssistedNodeInformation):
511         (WebKit::hasAssistableElement): Deleted.
512
513         Since we need the next or previous focusable element to get its rect, we don't need this helper anymore.
514
515 2018-03-26  Chris Dumez  <cdumez@apple.com>
516
517         Use SecurityOriginData more consistently in Service Worker code
518         https://bugs.webkit.org/show_bug.cgi?id=183969
519
520         Reviewed by Darin Adler.
521
522         Use SecurityOriginData more consistently in Service Worker code to avoid constructing
523         SecurityOrigin objects unnecessarily.
524
525         * NetworkProcess/NetworkResourceLoadParameters.cpp:
526         (WebKit::NetworkResourceLoadParameters::encode const):
527         * Shared/API/c/WKSecurityOriginRef.cpp:
528         (WKSecurityOriginCopyDatabaseIdentifier):
529         * StorageProcess/ServiceWorker/WebSWOriginStore.cpp:
530         (WebKit::WebSWOriginStore::addToStore):
531         (WebKit::WebSWOriginStore::removeFromStore):
532         * StorageProcess/ServiceWorker/WebSWOriginStore.h:
533         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
534         (WebKit::WebSWServerConnection::scheduleJobInServer):
535         (WebKit::WebSWServerConnection::registerServiceWorkerClient):
536         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
537         (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
538         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
539         * StorageProcess/StorageProcess.cpp:
540         (WebKit::StorageProcess::connectionToContextProcessWasClosed):
541         (WebKit::StorageProcess::needsServerToContextConnectionForOrigin const):
542         (WebKit::StorageProcess::createStorageToWebProcessConnection):
543         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
544         (WebKit::StorageProcess::serverToContextConnectionForOrigin):
545         (WebKit::StorageProcess::createServerToContextConnection):
546         (WebKit::StorageProcess::swContextConnectionMayNoLongerBeNeeded):
547         * StorageProcess/StorageProcess.h:
548         * UIProcess/API/APIFrameInfo.cpp:
549         (API::FrameInfo::create):
550         * UIProcess/API/C/WKApplicationCacheManager.cpp:
551         (WKApplicationCacheManagerDeleteEntriesForOrigin):
552         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
553         (WKKeyValueStorageManagerDeleteEntriesForOrigin):
554         * UIProcess/API/C/WKResourceCacheManager.cpp:
555         (WKResourceCacheManagerClearCacheForOrigin):
556         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
557         (WKWebsiteDataStoreRemoveFetchCacheForOrigin):
558         (WKWebsiteDataStoreGetFetchCacheSizeForOrigin):
559         * UIProcess/ServiceWorkerProcessProxy.cpp:
560         (WebKit::ServiceWorkerProcessProxy::create):
561         (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
562         (WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
563         * UIProcess/ServiceWorkerProcessProxy.h:
564         * UIProcess/Storage/StorageProcessProxy.cpp:
565         (WebKit::StorageProcessProxy::getStorageProcessConnection):
566         * UIProcess/WebProcessPool.cpp:
567         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
568         (WebKit::WebProcessPool::disconnectProcess):
569         (WebKit::WebProcessPool::updateProcessAssertions):
570         * UIProcess/WebProcessPool.h:
571         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
572         (WebKit::WebsiteDataStore::fetchDataAndApply):
573         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
574         (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
575         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
576         (WKBundlePageCopyOriginsWithApplicationCache):
577         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
578         (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
579         (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices):
580         * WebProcess/Storage/WebSWClientConnection.cpp:
581         (WebKit::WebSWClientConnection::registerServiceWorkerClient):
582         (WebKit::WebSWClientConnection::matchRegistration):
583         (WebKit::WebSWClientConnection::whenRegistrationReady):
584         (WebKit::WebSWClientConnection::getRegistrations):
585         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
586         (WebKit::WebChromeClient::exceededDatabaseQuota):
587         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
588         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
589         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
590         * WebProcess/WebProcess.cpp:
591         (WebKit::WebProcess::fetchWebsiteData):
592         * WebProcess/WebStorage/StorageAreaImpl.cpp:
593         (WebKit::StorageAreaImpl::securityOrigin const):
594         * WebProcess/WebStorage/StorageAreaImpl.h:
595         * WebProcess/WebStorage/StorageAreaMap.cpp:
596         (WebKit::StorageAreaMap::StorageAreaMap):
597         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
598         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
599         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
600         (WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap):
601
602 2018-03-26  Brent Fulgham  <bfulgham@apple.com>
603
604         Warn against cookie access in the WebContent process using ProcessPrivilege assertions
605         https://bugs.webkit.org/show_bug.cgi?id=183911
606         <rdar://problem/38762306>
607
608         Reviewed by Youenn Fablet.
609
610         Add a set of ProcessPrivilege assertions to enforce the rule that the WebContent process
611         should never call Cookie API directly. That should only happen in the Networking or
612         UIProcess. 
613
614         * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
615         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
616         (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):
617         * NetworkProcess/NetworkProcess.cpp:
618         (WebKit::NetworkProcess::initializeNetworkProcess):
619         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
620         (WebKit::NetworkDataTaskCocoa::applyCookieBlockingPolicy):
621         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
622         (WebKit::NetworkProcess::setSharedHTTPCookieStorage):
623         (WebKit::NetworkProcess::syncAllCookies):
624         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
625         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
626         * NetworkProcess/mac/RemoteNetworkingContext.mm:
627         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
628         * PluginProcess/PluginProcess.cpp:
629         (WebKit::PluginProcess::initializeProcess):
630         * Shared/cf/CookieStorageUtilsCF.mm:
631         (WebKit::cookieStorageFromIdentifyingData):
632         (WebKit::identifyingDataFromCookieStorage):
633         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
634         (WebKit::WebProcessPool::platformInitializeWebProcess):
635         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
636         (WebKit::privateBrowsingSession):
637         * UIProcess/WebProcessPool.cpp:
638         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
639         (WebKit::WebsiteDataStore::parameters):
640         * UIProcess/mac/WebCookieManagerProxyMac.mm:
641         (WebKit::WebCookieManagerProxy::persistHTTPCookieAcceptPolicy):
642         * WebProcess/InjectedBundle/InjectedBundle.cpp:
643         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
644         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
645         (WebKit::WebFrameLoaderClient::createNetworkingContext):
646         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
647         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
648         (WebKit::WebFrameNetworkingContext::storageSession const):
649         * WebProcess/WebProcess.cpp:
650         (WebKit::WebProcess::initializeProcess):
651
652 2018-03-26  Alex Christensen  <achristensen@webkit.org>
653
654         Merge ResourceHandleClient::willCacheResponseAsync with ResourceHandleClient::willCacheResponse
655         https://bugs.webkit.org/show_bug.cgi?id=183965
656
657         Reviewed by Chris Dumez.
658
659         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
660         (WebKit::WebFrameLoaderClient::willCacheResponse const):
661         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
662
663 2018-03-25  Carlos Garcia Campos  <cgarcia@igalia.com>
664
665         [GTK][WPE] Add API to convert between DOM and JSCValue
666         https://bugs.webkit.org/show_bug.cgi?id=183448
667
668         Reviewed by Michael Catanzaro.
669
670         Add methods to get a JSCValue for a WebKitDOMObject and to create a WebKitDOMNode from a JSCValue. Deprecate
671         most of the GTK+ DOM bindings API and move the non-deprecated parts to glib dir to be exposed by WPE too.
672
673         * PlatformGTK.cmake:
674         * PlatformWPE.cmake:
675         * SourcesGTK.txt:
676         * SourcesWPE.txt:
677         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
678         * WebProcess/InjectedBundle/API/glib/DOM/DOMObjectCache.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/DOMObjectCache.cpp.
679         * WebProcess/InjectedBundle/API/glib/DOM/DOMObjectCache.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/DOMObjectCache.h.
680         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMDocument.cpp: Added.
681         (WebKit::kit):
682         (WebKit::core):
683         (WebKit::wrapDocument):
684         (webkit_dom_document_class_init):
685         (webkit_dom_document_init):
686         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMDocumentPrivate.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentPrivate.h.
687         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMElement.cpp: Added.
688         (WebKit::kit):
689         (WebKit::core):
690         (WebKit::wrapElement):
691         (webkit_dom_element_class_init):
692         (webkit_dom_element_init):
693         (webkit_dom_element_html_input_element_is_user_edited):
694         (webkit_dom_element_html_input_element_get_auto_filled):
695         (webkit_dom_element_html_input_element_set_auto_filled):
696         (webkit_dom_element_html_input_element_set_editing_value):
697         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMElementPrivate.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementPrivate.h.
698         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMNode.cpp: Added.
699         (_WebKitDOMNodePrivate::~_WebKitDOMNodePrivate):
700         (WebKit::kit):
701         (WebKit::core):
702         (WebKit::wrapNode):
703         (webkitDOMNodeConstructor):
704         (webkitDOMNodeFinalize):
705         (webkit_dom_node_init):
706         (webkit_dom_node_class_init):
707         (webkitDOMNodeSetCoreObject):
708         (webkitDOMNodeGetCoreObject):
709         (webkit_dom_node_for_js_value):
710         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMNodePrivate.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodePrivate.h.
711         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMObject.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObject.cpp.
712         (webkitDOMObjectSetProperty):
713         (webkit_dom_object_class_init):
714         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMPrivate.cpp: Added.
715         (WebKit::wrap):
716         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMPrivate.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/DOMObjectCache.h.
717         * WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp:
718         (webkit_frame_get_js_value_for_dom_object):
719         (webkit_frame_get_js_value_for_dom_object_in_script_world):
720         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
721         (webkit_web_page_class_init):
722         (webkitWebPageCreate):
723         (webkit_web_page_get_dom_document):
724         * WebProcess/InjectedBundle/API/gtk/DOM/GObjectEventListener.cpp:
725         (WebKit::GObjectEventListener::handleEvent):
726         * WebProcess/InjectedBundle/API/gtk/DOM/GObjectNodeFilterCondition.cpp:
727         * WebProcess/InjectedBundle/API/gtk/DOM/GObjectXPathNSResolver.cpp:
728         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp:
729         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.h:
730         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.cpp:
731         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.h:
732         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp:
733         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.h:
734         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.cpp:
735         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.h:
736         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.cpp:
737         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.h:
738         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.cpp:
739         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.h:
740         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.cpp:
741         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.h:
742         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp:
743         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.h:
744         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
745         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.h:
746         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.cpp:
747         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.h:
748         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp:
749         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.h:
750         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp:
751         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.h:
752         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.cpp:
753         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.h:
754         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:
755         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.h:
756         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:
757         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.h:
758         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
759         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.h:
760         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
761         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.h:
762         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
763         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.h:
764         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp.
765         (webkitDOMDocumentDOMEventTargetInit):
766         (webkitDOMDocumentInstallProperties):
767         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp:
768         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.h:
769         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.h:
770         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp.
771         (webkitDOMElementDOMEventTargetInit):
772         (webkitDOMElementInstallProperties):
773         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
774         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.h:
775         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEventTarget.cpp:
776         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEventTarget.h:
777         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.cpp:
778         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.h:
779         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.cpp:
780         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.h:
781         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp:
782         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.h:
783         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp:
784         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.h:
785         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp:
786         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.h:
787         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp:
788         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.h:
789         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp:
790         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.h:
791         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp:
792         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.h:
793         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp:
794         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.h:
795         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp:
796         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.h:
797         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.cpp:
798         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.h:
799         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp:
800         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.h:
801         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp:
802         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.h:
803         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp:
804         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.h:
805         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp:
806         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.h:
807         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
808         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.h:
809         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp:
810         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.h:
811         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp:
812         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.h:
813         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.cpp:
814         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.h:
815         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.cpp:
816         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.h:
817         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.cpp:
818         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.h:
819         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.cpp:
820         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.h:
821         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.cpp:
822         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.h:
823         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.cpp:
824         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.h:
825         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.cpp:
826         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.h:
827         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.cpp:
828         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.h:
829         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.cpp:
830         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.h:
831         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.cpp:
832         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.h:
833         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
834         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.h:
835         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.cpp:
836         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.h:
837         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.cpp:
838         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.h:
839         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.cpp:
840         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.h:
841         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.cpp:
842         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.h:
843         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.cpp:
844         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.h:
845         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.cpp:
846         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.h:
847         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp:
848         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.h:
849         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.cpp:
850         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.h:
851         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.cpp:
852         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.h:
853         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.cpp:
854         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.h:
855         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.cpp:
856         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.h:
857         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.cpp:
858         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.h:
859         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp:
860         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.h:
861         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.cpp:
862         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.h:
863         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.cpp:
864         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.h:
865         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.cpp:
866         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.h:
867         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp:
868         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.h:
869         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPrivate.cpp:
870         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.cpp:
871         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.h:
872         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.cpp:
873         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.h:
874         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
875         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.h:
876         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.cpp:
877         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.h:
878         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.cpp:
879         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.h:
880         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp:
881         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.h:
882         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.cpp:
883         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.h:
884         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
885         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.h:
886         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
887         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.h:
888         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
889         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.h:
890         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.cpp:
891         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.h:
892         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.cpp:
893         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.h:
894         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.cpp:
895         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.h:
896         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.cpp:
897         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.h:
898         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp:
899         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.h:
900         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.cpp:
901         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.h:
902         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp:
903         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.h:
904         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.h:
905         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeFilter.cpp:
906         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeFilter.h:
907         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.cpp.
908         (webkitDOMNodeDOMEventTargetInit):
909         (webkitDOMNodeInstallProperties):
910         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.cpp:
911         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.h:
912         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.cpp:
913         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.h:
914         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObject.h:
915         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivateGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.cpp.
916         (WebKit::wrapNodeGtk):
917         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivateGtk.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.h.
918         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.cpp:
919         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.h:
920         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.cpp:
921         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.h:
922         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.cpp:
923         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.h:
924         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.cpp:
925         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.h:
926         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
927         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.h:
928         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.cpp:
929         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.h:
930         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.cpp:
931         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.h:
932         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.cpp:
933         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.h:
934         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.cpp:
935         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.h:
936         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathNSResolver.cpp:
937         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathNSResolver.h:
938         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.cpp:
939         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.h:
940         * WebProcess/InjectedBundle/API/gtk/DOM/docs/webkitdomgtk-4.0-sections.txt:
941         * WebProcess/InjectedBundle/API/gtk/WebKitFrame.h:
942         * WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMDefines.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentPrivate.h.
943         * WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMDocument.h: Added.
944         * WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMElement.h: Added.
945         * WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMNode.h: Added.
946         * WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMObject.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObject.h.
947         * WebProcess/InjectedBundle/API/wpe/DOM/webkitdom.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodePrivate.h.
948         * WebProcess/InjectedBundle/API/wpe/WebKitFrame.h:
949         * WebProcess/InjectedBundle/API/wpe/WebKitWebHitTestResult.h: Added.
950         * WebProcess/InjectedBundle/API/wpe/WebKitWebPage.h:
951         * WebProcess/InjectedBundle/API/wpe/WebKitWebProcessEnumTypes.cpp.template: Added.
952         * WebProcess/InjectedBundle/API/wpe/WebKitWebProcessEnumTypes.h.template: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObjectPrivate.h.
953         * WebProcess/InjectedBundle/API/wpe/webkit-web-extension.h:
954
955 2018-03-26  Zan Dobersek  <zdobersek@igalia.com>
956
957         [CoordGraphics] Clean up CoordinatedGraphicsScene construct-time initializations
958         https://bugs.webkit.org/show_bug.cgi?id=184002
959
960         Reviewed by Carlos Garcia Campos.
961
962         Move the CoordinatedGraphicsScene constant-expression initializations
963         from constructor to the point of declaration.
964
965         Default the CoordinatedGraphicsScene destructor.
966
967         The m_scrollPosition member variable is unused in this class, while the
968         similarly-named m_renderedContentsScrollPosition tracks scroll position
969         of the scene. Remove the latter and use m_scrollPosition in its place.
970
971         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
972         (WebKit::CoordinatedGraphicsScene::CoordinatedGraphicsScene):
973         (WebKit::CoordinatedGraphicsScene::adjustPositionForFixedLayers):
974         (WebKit::CoordinatedGraphicsScene::commitSceneState):
975         (WebKit::CoordinatedGraphicsScene::~CoordinatedGraphicsScene): Deleted.
976         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
977
978 2018-03-25  Michael Catanzaro  <mcatanzaro@igalia.com>
979
980         [GTK] WebKitWebProcessEnumTypes.h missing from webkit-web-extension.h
981         https://bugs.webkit.org/show_bug.cgi?id=183998
982
983         Reviewed by Carlos Garcia Campos.
984
985         * WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h:
986
987 2018-03-25  Carlos Garcia Campos  <cgarcia@igalia.com>
988
989         [GTK] Unresolved type warnings when generating gir
990         https://bugs.webkit.org/show_bug.cgi?id=183926
991
992         Reviewed by Michael Catanzaro.
993
994         Skip deprecated functions using JSC C API from introspection.
995
996         * UIProcess/API/glib/WebKitJavascriptResult.cpp:
997         * UIProcess/API/glib/WebKitWebView.cpp:
998         * WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp:
999
1000 2018-03-25  Commit Queue  <commit-queue@webkit.org>
1001
1002         Unreviewed, rolling out r229954.
1003         https://bugs.webkit.org/show_bug.cgi?id=184000
1004
1005         Caused many layout tests to crash on Apple High Sierra,
1006         Sierra, iOS Simulator and GTK Linux Debug test bots (Requested
1007         by dydz on #webkit).
1008
1009         Reverted changeset:
1010
1011         "Use SecurityOriginData more consistently in Service Worker
1012         code"
1013         https://bugs.webkit.org/show_bug.cgi?id=183969
1014         https://trac.webkit.org/changeset/229954
1015
1016 2018-03-23  Brian Burg  <bburg@apple.com>
1017
1018         Web Automation: remove unnecessary member variable WebAutomationSession
1019         https://bugs.webkit.org/show_bug.cgi?id=183971
1020
1021         Reviewed by Timothy Hatcher.
1022
1023         The concept of the "active" browsing context is something in the WebDriver
1024         specification, but we were a bit too literal when first implementing this.
1025         There's no actual need for this on the browser side since most commands
1026         require implicitly switching to the target window passed in with the
1027         Automation command. The driver, however, still needs to track the current
1028         browsing context and current top-level browsing context.
1029
1030         For returning whether a browsing context is active,  we can just look at
1031         the page's activity state to know whether the page is active or not. For
1032         a normal browser, only one page is going to be visible and focused at a time.
1033
1034         * UIProcess/Automation/WebAutomationSession.h:
1035         * UIProcess/Automation/WebAutomationSession.cpp:
1036         (WebKit::WebAutomationSession::buildBrowsingContextForPage):
1037         Consult the page's activity state to determine whether it's active.
1038
1039         (WebKit::WebAutomationSession::createBrowsingContext):
1040         (WebKit::WebAutomationSession::closeBrowsingContext):
1041         (WebKit::WebAutomationSession::switchToBrowsingContext):
1042         (WebKit::WebAutomationSession::handleRunOpenPanel):
1043         Stop reading and writing the current browsing context handle.
1044
1045         * UIProcess/WebPageProxy.h:
1046         (WebKit::WebPageProxy::isViewFocused const):
1047         (WebKit::WebPageProxy::isViewWindowActive const):
1048         Add new accessor.
1049
1050 2018-03-25  Tim Horton  <timothy_horton@apple.com>
1051
1052         Add and adopt ENABLE(AIRPLAY_PICKER)
1053         https://bugs.webkit.org/show_bug.cgi?id=183992
1054
1055         Reviewed by Daniel Bates.
1056
1057         * UIProcess/ios/WKContentViewInteraction.h:
1058         * UIProcess/ios/WKContentViewInteraction.mm:
1059         (-[WKContentView _showPlaybackTargetPicker:fromRect:]):
1060         * UIProcess/ios/forms/WKAirPlayRoutePicker.h:
1061         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
1062
1063 2018-03-25  Tim Horton  <timothy_horton@apple.com>
1064
1065         Move WKAnimationDelegate to its own header
1066         https://bugs.webkit.org/show_bug.cgi?id=183976
1067         <rdar://problem/38822299>
1068
1069         Reviewed by Dan Bernstein.
1070
1071         * Shared/RemoteLayerTree/WKAnimationDelegate.h: Added.
1072         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
1073         * WebKit.xcodeproj/project.pbxproj:
1074         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
1075         RemoteLayerTreeHost uses a forward declaration of WKAnimationDelegate,
1076         so we're just getting lucky that an -invalidate method exists on
1077         some other object. Instead, move WKAnimationDelegate to its own
1078         header, and include it in the places we use it.
1079
1080 2018-03-24  Tim Horton  <timothy_horton@apple.com>
1081
1082         Adopt WK_PLATFORM_NAME in WebKit
1083         https://bugs.webkit.org/show_bug.cgi?id=183978
1084
1085         Reviewed by Dan Bernstein.
1086
1087         * Configurations/WebKit.xcconfig:
1088         * WebKit.xcodeproj/project.pbxproj:
1089         * mac/MigrateHeadersFromWebKitLegacy.make:
1090         * mac/postprocess-framework-headers.sh:
1091
1092 2018-03-24  Tim Horton  <timothy_horton@apple.com>
1093
1094         Ignore sandbox_init_with_parameters deprecation warnings
1095         https://bugs.webkit.org/show_bug.cgi?id=183979
1096
1097         Reviewed by Dan Bernstein.
1098
1099         * Shared/ios/ChildProcessIOS.mm:
1100         (WebKit::ChildProcess::initializeSandbox):
1101
1102 2018-03-24  Chris Dumez  <cdumez@apple.com>
1103
1104         Use SecurityOriginData more consistently in Service Worker code
1105         https://bugs.webkit.org/show_bug.cgi?id=183969
1106
1107         Reviewed by Darin Adler.
1108
1109         Use SecurityOriginData more consistently in Service Worker code to avoid constructing
1110         SecurityOrigin objects unnecessarily.
1111
1112         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1113         (WebKit::NetworkResourceLoadParameters::encode const):
1114         * Shared/API/c/WKSecurityOriginRef.cpp:
1115         (WKSecurityOriginCopyDatabaseIdentifier):
1116         * StorageProcess/ServiceWorker/WebSWOriginStore.cpp:
1117         (WebKit::WebSWOriginStore::addToStore):
1118         (WebKit::WebSWOriginStore::removeFromStore):
1119         * StorageProcess/ServiceWorker/WebSWOriginStore.h:
1120         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1121         (WebKit::WebSWServerConnection::scheduleJobInServer):
1122         (WebKit::WebSWServerConnection::registerServiceWorkerClient):
1123         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
1124         (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
1125         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
1126         * StorageProcess/StorageProcess.cpp:
1127         (WebKit::StorageProcess::connectionToContextProcessWasClosed):
1128         (WebKit::StorageProcess::needsServerToContextConnectionForOrigin const):
1129         (WebKit::StorageProcess::createStorageToWebProcessConnection):
1130         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
1131         (WebKit::StorageProcess::serverToContextConnectionForOrigin):
1132         (WebKit::StorageProcess::createServerToContextConnection):
1133         (WebKit::StorageProcess::swContextConnectionMayNoLongerBeNeeded):
1134         * StorageProcess/StorageProcess.h:
1135         * UIProcess/API/APIFrameInfo.cpp:
1136         (API::FrameInfo::create):
1137         * UIProcess/API/C/WKApplicationCacheManager.cpp:
1138         (WKApplicationCacheManagerDeleteEntriesForOrigin):
1139         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
1140         (WKKeyValueStorageManagerDeleteEntriesForOrigin):
1141         * UIProcess/API/C/WKResourceCacheManager.cpp:
1142         (WKResourceCacheManagerClearCacheForOrigin):
1143         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1144         (WKWebsiteDataStoreRemoveFetchCacheForOrigin):
1145         (WKWebsiteDataStoreGetFetchCacheSizeForOrigin):
1146         * UIProcess/ServiceWorkerProcessProxy.cpp:
1147         (WebKit::ServiceWorkerProcessProxy::create):
1148         (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
1149         (WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
1150         * UIProcess/ServiceWorkerProcessProxy.h:
1151         * UIProcess/Storage/StorageProcessProxy.cpp:
1152         (WebKit::StorageProcessProxy::getStorageProcessConnection):
1153         * UIProcess/WebProcessPool.cpp:
1154         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
1155         (WebKit::WebProcessPool::disconnectProcess):
1156         (WebKit::WebProcessPool::updateProcessAssertions):
1157         * UIProcess/WebProcessPool.h:
1158         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1159         (WebKit::WebsiteDataStore::fetchDataAndApply):
1160         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
1161         (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
1162         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1163         (WKBundlePageCopyOriginsWithApplicationCache):
1164         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1165         (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
1166         (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices):
1167         * WebProcess/Storage/WebSWClientConnection.cpp:
1168         (WebKit::WebSWClientConnection::registerServiceWorkerClient):
1169         (WebKit::WebSWClientConnection::matchRegistration):
1170         (WebKit::WebSWClientConnection::whenRegistrationReady):
1171         (WebKit::WebSWClientConnection::getRegistrations):
1172         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1173         (WebKit::WebChromeClient::exceededDatabaseQuota):
1174         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
1175         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1176         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1177         * WebProcess/WebProcess.cpp:
1178         (WebKit::WebProcess::fetchWebsiteData):
1179         * WebProcess/WebStorage/StorageAreaImpl.cpp:
1180         (WebKit::StorageAreaImpl::securityOrigin const):
1181         * WebProcess/WebStorage/StorageAreaImpl.h:
1182         * WebProcess/WebStorage/StorageAreaMap.cpp:
1183         (WebKit::StorageAreaMap::StorageAreaMap):
1184         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
1185         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
1186         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
1187         (WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap):
1188
1189 2018-03-24  Tim Horton  <timothy_horton@apple.com>
1190
1191         Fix the !ENABLE(MEDIA_STREAM) build
1192         https://bugs.webkit.org/show_bug.cgi?id=183977
1193
1194         Reviewed by Wenson Hsieh.
1195
1196         * UIProcess/Cocoa/UIDelegate.mm:
1197         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
1198         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
1199         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1200         * WebProcess/cocoa/UserMediaCaptureManager.messages.in:
1201
1202 2018-03-24  Tim Horton  <timothy_horton@apple.com>
1203
1204         WKFileUploadPanel shouldn't depend on WebKitLegacy
1205         https://bugs.webkit.org/show_bug.cgi?id=183981
1206
1207         Reviewed by Wenson Hsieh.
1208
1209         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1210         (-[WKFileUploadPanel _uploadItemForImageData:imageName:successBlock:failureBlock:]):
1211         Just use the underlying WebCore function instead of the
1212         unnecessary NSFileManager category method.
1213
1214 2018-03-23  Tim Horton  <timothy_horton@apple.com>
1215
1216         Fix the build with no pasteboard
1217         https://bugs.webkit.org/show_bug.cgi?id=183973
1218
1219         Reviewed by Dan Bernstein.
1220
1221         * Configurations/FeatureDefines.xcconfig:
1222
1223 2018-03-23  Megan Gardner  <megan_gardner@apple.com>
1224
1225         Enable unified text selection in select cases for gradual testing
1226         https://bugs.webkit.org/show_bug.cgi?id=183967
1227         <rdar://problem/38815328>
1228
1229         Reviewed by Tim Horton.
1230         
1231         Enable in select places for a more gradual switch, as this is a big change and we want to make sure
1232         it works before switching completely.
1233
1234         * UIProcess/ios/WKContentViewInteraction.mm:
1235         (-[WKContentView useSelectionAssistantWithGranularity:]):
1236
1237 2018-03-23  John Wilander  <wilander@apple.com>
1238
1239         Resource Load Statistics: Pick up ITP debug mode flag from defaults
1240         https://bugs.webkit.org/show_bug.cgi?id=183956
1241         <rdar://problem/38559574>
1242
1243         Reviewed by Brent Fulgham.
1244
1245         * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
1246         (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
1247
1248 2018-03-23  Wenson Hsieh  <wenson_hsieh@apple.com>
1249
1250         [Extra zoom mode] Adopt list view controller UI for select menus
1251         https://bugs.webkit.org/show_bug.cgi?id=183944
1252         <rdar://problem/38799062>
1253
1254         Reviewed by Tim Horton.
1255
1256         Move UIProcess/WKSelectMenuListViewController.* to UIProcess/ios/forms, where it was intended to go.
1257
1258         * UIProcess/ios/forms/WKSelectMenuListViewController.h: Renamed from Source/WebKit/UIProcess/WKSelectMenuListViewController.h.
1259         * UIProcess/ios/forms/WKSelectMenuListViewController.mm: Renamed from Source/WebKit/UIProcess/WKSelectMenuListViewController.mm.
1260         * WebKit.xcodeproj/project.pbxproj:
1261
1262 2018-03-23  Chris Dumez  <cdumez@apple.com>
1263
1264         Promptly terminate service worker processes when they are no longer needed
1265         https://bugs.webkit.org/show_bug.cgi?id=183873
1266         <rdar://problem/38676995>
1267
1268         Reviewed by Youenn Fablet.
1269
1270         The StorageProcess now keeps track of service worker clients for each security
1271         origin. When there is no longer any clients for a given security origin, the
1272         StorageProcess asks the service worker process for the given origin to terminate
1273         and severs its connection to it.
1274
1275         * Shared/Storage/StorageProcessCreationParameters.h:
1276         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
1277         (WebKit::WebSWServerToContextConnection::connectionMayNoLongerBeNeeded):
1278         (WebKit::WebSWServerToContextConnection::terminate):
1279         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
1280         * StorageProcess/StorageProcess.cpp:
1281         (WebKit::StorageProcess::connectionToContextProcessWasClosed):
1282         (WebKit::StorageProcess::needsServerToContextConnectionForOrigin const):
1283         (WebKit::StorageProcess::initializeWebsiteDataStore):
1284         (WebKit::StorageProcess::swServerForSession):
1285         (WebKit::StorageProcess::swContextConnectionMayNoLongerBeNeeded):
1286         (WebKit::StorageProcess::disableServiceWorkerProcessTerminationDelay):
1287         * StorageProcess/StorageProcess.h:
1288         * StorageProcess/StorageProcess.messages.in:
1289         * UIProcess/API/Cocoa/WKProcessPool.mm:
1290         (-[WKProcessPool _disableServiceWorkerProcessTerminationDelay]):
1291         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1292         * UIProcess/WebProcessPool.cpp:
1293         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
1294         (WebKit::WebProcessPool::disableServiceWorkerProcessTerminationDelay):
1295         * UIProcess/WebProcessPool.h:
1296         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1297         (WebKit::WebSWContextManagerConnection::terminateProcess):
1298         * WebProcess/Storage/WebSWContextManagerConnection.h:
1299         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
1300
1301 2018-03-23  Brady Eidson  <beidson@apple.com>
1302
1303         Go to back/forward list items after a process-swapped navigation.
1304         <rdar://problem/38690544> and https://bugs.webkit.org/show_bug.cgi?id=183920
1305
1306         Reviewed by Andy Estes.
1307
1308         This takes the initial work of "process swap a normal navigation" and extends it to
1309         process swapping for back/forward item navigations.
1310
1311         * Scripts/webkit/messages.py:
1312
1313         Make sure state objects are serialized to the UI Process back/forward list items, as otherwise
1314         they will be lost in process-swap scenarios:
1315         * Shared/SessionState.cpp:
1316         (WebKit::PageState::encode const):
1317         (WebKit::PageState::decode):
1318         * Shared/SessionState.h:
1319
1320         Make a new variant of APINavigation specifically for back/forward list items.
1321         * UIProcess/API/APINavigation.cpp:
1322         (API::Navigation::Navigation):
1323         (API::Navigation::loggingURL const):
1324         * UIProcess/API/APINavigation.h:
1325         (API::Navigation::create):
1326         (API::Navigation::backForwardListItem):
1327         (API::Navigation::backForwardFrameLoadType const):
1328
1329         * UIProcess/API/C/WKPage.cpp:
1330         (WKPageGoToBackForwardListItem):
1331
1332         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
1333         (-[WKBrowsingContextController goToBackForwardListItem:]):
1334
1335         * UIProcess/API/Cocoa/WKWebView.mm:
1336         (-[WKWebView goToBackForwardListItem:]):
1337
1338         * UIProcess/WebNavigationState.cpp:
1339         (WebKit::WebNavigationState::createLoadRequestNavigation):
1340         (WebKit::WebNavigationState::createBackForwardNavigation):
1341         * UIProcess/WebNavigationState.h:
1342
1343         * UIProcess/WebPageProxy.cpp:
1344         (WebKit::WebPageProxy::reattachToWebProcessForReload):
1345         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
1346         (WebKit::WebPageProxy::goForward):
1347         (WebKit::WebPageProxy::goBack):
1348         (WebKit::WebPageProxy::goToBackForwardItem):
1349         (WebKit::WebPageProxy::receivedPolicyDecision):
1350         (WebKit::WebPageProxy::continueNavigationInNewProcess): Handle back/forward navigations differently than others.
1351         (WebKit::WebPageProxy::restoreFromSessionState):
1352         * UIProcess/WebPageProxy.h:
1353
1354         * UIProcess/WebProcessProxy.cpp:
1355         (WebKit::WebProcessProxy::addOrUpdateBackForwardItem): Renamed from "addBackForwardItem" for clarity
1356         (WebKit::WebProcessProxy::addBackForwardItem): Deleted.
1357         * UIProcess/WebProcessProxy.h:
1358         * UIProcess/WebProcessProxy.messages.in:
1359
1360         * UIProcess/ios/ViewGestureControllerIOS.mm:
1361         (WebKit::ViewGestureController::endSwipeGesture):
1362
1363         * UIProcess/mac/ViewGestureControllerMac.mm:
1364         (WebKit::ViewGestureController::endSwipeGesture):
1365
1366         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
1367         (WebKit::toPageState):
1368         (WebKit::toHistoryItem):
1369
1370         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
1371         (WebKit::updateBackForwardItem):
1372
1373         * WebProcess/WebPage/WebPage.cpp:
1374         (WebKit::WebPage::goToBackForwardItem): Combined "goBack" and "goForward" with this method,
1375           passing the appropriate FrameLoadType around as needed to remember the specific type.
1376         (WebKit::WebPage::goForward): Deleted.
1377         (WebKit::WebPage::goBack): Deleted.
1378         * WebProcess/WebPage/WebPage.h:
1379         * WebProcess/WebPage/WebPage.messages.in:
1380
1381 2018-03-23  Megan Gardner  <megan_gardner@apple.com>
1382
1383         Don't use the presence of a textSelectionAssistant as a proxy for if we are in content editable.
1384         https://bugs.webkit.org/show_bug.cgi?id=183804
1385
1386         Reviewed by Tim Horton.
1387
1388         We need to stop using the presence of a textSelectionAssistant as a proxy for if we are selecting in a content editable
1389         or not. As we are planning on switching to only using a textSelectionAssistant for selection, these checks need to 
1390         be more direct in checking what we actually need to know i.e. are we selecting in a content editable.
1391
1392         * Platform/spi/ios/UIKitSPI.h:
1393         * UIProcess/ios/WKContentViewInteraction.mm:
1394         (hasAssistedNode):
1395         (-[WKContentView inputView]):
1396         (-[WKContentView _selectionClipRect]):
1397         (-[WKContentView gestureRecognizer:canBePreventedByGestureRecognizer:]):
1398         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
1399         (-[WKContentView gestureRecognizerShouldBegin:]):
1400         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
1401         (-[WKContentView webSelectionRects]):
1402         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1403         (-[WKContentView _autofillContext]):
1404
1405 2018-03-23  Youenn Fablet  <youenn@apple.com>
1406
1407         WebProcessPool should not ask to register all clients for each service worker process creation
1408         https://bugs.webkit.org/show_bug.cgi?id=183941
1409
1410         Reviewed by Chris Dumez.
1411
1412         Call registerServiceWorkerClients when there is no service worker process.
1413         Update service worker clients to register all of them no matter the session ID.
1414
1415         * UIProcess/WebProcessPool.cpp:
1416         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
1417         * WebProcess/WebProcess.cpp:
1418         (WebKit::WebProcess::registerServiceWorkerClients):
1419         * WebProcess/WebProcess.h:
1420         * WebProcess/WebProcess.messages.in:
1421
1422 2018-03-23  Wenson Hsieh  <wenson_hsieh@apple.com>
1423
1424         [Extra zoom mode] Adopt list view controller UI for select menus
1425         https://bugs.webkit.org/show_bug.cgi?id=183944
1426         <rdar://problem/38799062>
1427
1428         Reviewed by Andy Estes.
1429
1430         Rename WKSelectMenuViewController to WKSelectMenuListViewController, and also rename the relevant
1431         WebKitAdditions harness files. See corresponding changes for more details.
1432
1433         * UIProcess/WKSelectMenuListViewController.h: Renamed from Source/WebKit/UIProcess/ios/forms/WKSelectMenuViewController.h.
1434         * UIProcess/WKSelectMenuListViewController.mm: Renamed from Source/WebKit/UIProcess/ios/forms/WKSelectMenuViewController.mm.
1435         * UIProcess/ios/WKContentViewInteraction.h:
1436         * UIProcess/ios/WKContentViewInteraction.mm:
1437         (-[WKContentView presentSelectMenuViewController:]):
1438         (-[WKContentView dismissSelectMenuViewController:]):
1439         (-[WKContentView selectMenu:didSelectItemAtIndex:]):
1440         (-[WKContentView numberOfItemsInSelectMenu:]):
1441         (-[WKContentView selectMenu:displayTextForItemAtIndex:]):
1442         (-[WKContentView selectMenu:didCheckItemAtIndex:checked:]):
1443         (-[WKContentView selectMenuUsesMultipleSelection:]):
1444         (-[WKContentView selectMenu:hasSelectedOptionAtIndex:]):
1445         (-[WKContentView _wheelChangedWithEvent:]):
1446
1447         Overriding wheel events and re-dispatching them is no longer needed after r229437, so we can just remove special
1448         handling for select menus here.
1449
1450         (-[WKContentView didCancelSelectionInSelectMenu:]): Deleted.
1451         (-[WKContentView selectMenuSupportsMultipleSelection:]): Deleted.
1452         (-[WKContentView selectMenu:hasCheckedOptionAtIndex:]): Deleted.
1453         (-[WKContentView startingIndexForSelectMenu:]): Deleted.
1454
1455         The starting index for a select menu is no longer relevant when using list view controllers for input, so we can
1456         just remove this delegate hook altogether.
1457
1458         * WebKit.xcodeproj/project.pbxproj:
1459
1460 2018-03-23  Youenn Fablet  <youenn@apple.com>
1461
1462         CacheStorage::Caches should clear m_caches when clearing its representation even though it is not yet initialized
1463         https://bugs.webkit.org/show_bug.cgi?id=183945
1464
1465         Reviewed by Chris Dumez.
1466
1467         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1468         (WebKit::CacheStorage::Caches::clearMemoryRepresentation):
1469         In case we clear Caches in the middle of the initialization, m_caches might not be empty
1470         but m_isInitialized is not yet set to true since we are computing the Caches size.
1471         Update the assertion and clear m_caches in that case.
1472
1473 2018-03-23  David Kilzer  <ddkilzer@apple.com>
1474
1475         Stop using dispatch_set_target_queue()
1476         <https://webkit.org/b/183908>
1477         <rdar://problem/33553533>
1478
1479         Reviewed by Daniel Bates.
1480
1481         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
1482         (WebKit::NetworkCache::IOChannel::IOChannel): Remove the call to
1483         dispatch_set_target_queue() since this is handled in the
1484         dispatch_io_create() call above.
1485
1486 2018-03-23  Youenn Fablet  <youenn@apple.com>
1487
1488         CacheStorage::Engine should not ref itself when hopping to a background thread
1489         https://bugs.webkit.org/show_bug.cgi?id=183925
1490         <rdar://problem/38580483>
1491
1492         Reviewed by Chris Dumez.
1493
1494         Add support for weak pointers to CacheStorage Engine.
1495         Use weak pointer when hopping to background threads.
1496         Store callbacks in CacheStorage::Engine maps to keep them being destroyed in the main thread only.
1497         Made some callbacks CompletionHandler as a bonus.
1498
1499         Made sure to use just one Engine for all private sessions.
1500
1501         * NetworkProcess/cache/CacheStorageEngine.cpp:
1502         (WebKit::CacheStorage::Engine::~Engine):
1503         (WebKit::CacheStorage::Engine::from):
1504         (WebKit::CacheStorage::Engine::initialize):
1505         (WebKit::CacheStorage::Engine::writeFile):
1506         (WebKit::CacheStorage::Engine::readFile):
1507         * NetworkProcess/cache/CacheStorageEngine.h:
1508         (WebKit::CacheStorage::Engine::weakPtrFactory):
1509
1510 2018-03-23  Ryan Haddad  <ryanhaddad@apple.com>
1511
1512         Unreviewed build fix.
1513
1514         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1515
1516 2018-03-23  Miguel Gomez  <magomez@igalia.com>
1517
1518         [GTK][WPE] Avoid software color conversion inside BitmapTextureGL
1519         https://bugs.webkit.org/show_bug.cgi?id=183892
1520
1521         Remove the UpdateContentsFlag parameter when calling BitmapTexture::updateContents().
1522
1523         Reviewed by Žan Doberšek.
1524
1525         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
1526         (WebKit::CoordinatedBackingStoreTile::swapBuffers):
1527
1528 2018-03-23  Michael Catanzaro  <mcatanzaro@igalia.com>
1529
1530         [WPE][GTK] Fix -Wswitch warnings after r229778
1531         https://bugs.webkit.org/show_bug.cgi?id=183927
1532
1533         Reviewed by Carlos Garcia Campos.
1534
1535         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1536         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse): Log a warning if Suspend is
1537         received as a PolicyAction
1538         * UIProcess/API/glib/WebKitNavigationClient.cpp: Ignore the ProcessSwap termination reason,
1539         which should be invisible to WebKit clients
1540
1541 2018-03-22  Chris Dumez  <cdumez@apple.com>
1542
1543         Include security origin in the service worker process name
1544         https://bugs.webkit.org/show_bug.cgi?id=183913
1545
1546         Reviewed by Youenn Fablet.
1547
1548         Include security origin in the service worker process name to facilitate debugging. This way, we
1549         can differentiate which service worker process is used for which origin in activity monitor.
1550
1551         * Shared/ChildProcess.h:
1552         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
1553         (WebKit::XPCServiceInitializerDelegate::getExtraInitializationData):
1554         * UIProcess/ServiceWorkerProcessProxy.cpp:
1555         (WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
1556         * WebProcess/cocoa/WebProcessCocoa.mm:
1557         (WebKit::WebProcess::initializeProcessName):
1558
1559 2018-03-22  Michael Catanzaro  <mcatanzaro@igalia.com>
1560
1561         Unreviewed, silence unused variable warning
1562
1563         * UIProcess/WebPageProxy.cpp:
1564         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1565
1566 2018-03-22  Dan Bernstein  <mitz@apple.com>
1567
1568         WKWebView doesn’t expose its spellCheckerDocumentTag
1569         https://bugs.webkit.org/show_bug.cgi?id=183797
1570         <rdar://problem/38678089>
1571
1572         Reviewed by Tim Horton.
1573
1574         * UIProcess/API/Cocoa/WKWebView.mm:
1575         (-[WKWebView _spellCheckerDocumentTag]): Added this getter which calls through to the WebViewImpl.
1576         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared _spellCheckerDocumentTag property.
1577
1578 2018-03-22  Chris Dumez  <cdumez@apple.com>
1579
1580         Use the same SWServer for all ephemeral sessions
1581         https://bugs.webkit.org/show_bug.cgi?id=183921
1582         <rdar://problem/36873075>
1583
1584         Reviewed by Youenn Fablet.
1585
1586         Use the same SWServer for all ephemeral sessions. SWServers never go away and we create
1587         one per sessionID. When browsing doing private browsing in Safari (and other fetching
1588         favorite icons), the sessionID is ephemeral and keeps changing. This means that we kept
1589         constructing new SWServers that would never go away. Each SWServer has a thread so we
1590         would eventually hit the thread limit for the storage process.
1591
1592         * StorageProcess/StorageProcess.cpp:
1593         (WebKit::StorageProcess::swServerForSession):
1594
1595 2018-03-22  Michael Catanzaro  <mcatanzaro@igalia.com>
1596
1597         Unreviewed, fix format string warnings in service worker code
1598
1599         On Linux x86_64, uint64_t is unsigned long, not unsigned long long.
1600
1601         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1602         (WebKit::WebSWServerConnection::startFetch):
1603         (WebKit::WebSWServerConnection::didFinishFetch):
1604         (WebKit::WebSWServerConnection::didFailFetch):
1605         (WebKit::WebSWServerConnection::didNotHandleFetch):
1606
1607 2018-03-22  Daniel Bates  <dabates@apple.com>
1608
1609         Expose SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest() as WebKit SPI
1610         https://bugs.webkit.org/show_bug.cgi?id=183907
1611         <rdar://problem/38759127>
1612
1613         Reviewed by Alex Christensen.
1614
1615         Adds both modern Objective-C SPI and C SPI to allow an embedding client to register a scheme
1616         whose content should be displayed/loaded if and only if it can be requested. Disregarding an
1617         app that enables universal access, by using this SPI WebKit will refuse to display cross-origin
1618         content for the registered schemes.
1619
1620         We need to add C SPI for embedding clients that have not transitioned to the modern Objective-
1621         C API/SPI.
1622
1623         * Shared/WebProcessCreationParameters.cpp:
1624         (WebKit::WebProcessCreationParameters::encode const):
1625         (WebKit::WebProcessCreationParameters::decode):
1626         * Shared/WebProcessCreationParameters.h:
1627         * UIProcess/API/C/WKContext.cpp:
1628         (WKContextRegisterURLSchemeAsCanDisplayOnlyIfCanRequest):
1629         * UIProcess/API/C/WKContextPrivate.h:
1630         * UIProcess/API/Cocoa/WKProcessPool.mm:
1631         (-[WKProcessPool _registerURLSchemeAsCanDisplayOnlyIfCanRequest:]):
1632         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1633         * UIProcess/WebProcessPool.cpp:
1634         (WebKit::WebProcessPool::initializeNewWebProcess):
1635         (WebKit::WebProcessPool::registerURLSchemeAsCanDisplayOnlyIfCanRequest):
1636         * UIProcess/WebProcessPool.h:
1637         * WebProcess/WebProcess.cpp:
1638         (WebKit::WebProcess::initializeWebProcess):
1639         (WebKit::WebProcess::registerURLSchemeAsCanDisplayOnlyIfCanRequest const):
1640         * WebProcess/WebProcess.h:
1641         * WebProcess/WebProcess.messages.in:
1642
1643 2018-03-22  Tim Horton  <timothy_horton@apple.com>
1644
1645         Improve readability of WebCore's OTHER_LDFLAGS
1646         https://bugs.webkit.org/show_bug.cgi?id=183909
1647         <rdar://problem/38760992>
1648
1649         Reviewed by Dan Bernstein.
1650
1651         * Configurations/Base.xcconfig:
1652         * Configurations/FeatureDefines.xcconfig:
1653
1654 2018-03-22  Zan Dobersek  <zdobersek@igalia.com>
1655
1656         [TexMap] Make TextureMapperContextAttributes thread-specific
1657         https://bugs.webkit.org/show_bug.cgi?id=183895
1658
1659         Reviewed by Carlos Garcia Campos.
1660
1661         CoordinatedGraphicsScene, as an implementor of the
1662         TextureMapperPlatformLayerProxy::Compositor interface, doesn't have to
1663         implement the texmapGL() method anymore.
1664
1665         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1666         (WebKit::CoordinatedGraphicsScene::onNewBufferAvailable):
1667         (WebKit::CoordinatedGraphicsScene::texmapGL): Deleted.
1668         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1669
1670 2018-03-21  Frederic Wang  <fwang@igalia.com>
1671
1672         Unreviewed, update comment added in r229801.
1673
1674         * WebProcess/WebPage/ios/FindControllerIOS.mm:
1675         (WebKit::FindController::didFindString): Remove "On Mobile" and mention bug 183889.
1676
1677 2018-03-21  Chris Dumez  <cdumez@apple.com>
1678
1679         Regression(r229831): ProcessSwap.Basic API test is crashing
1680         https://bugs.webkit.org/show_bug.cgi?id=183884
1681
1682         Reviewed by Brady Eidson.
1683
1684         This code should only be called for navigation policy decisions.
1685         It used to work without this check because of an early return, which
1686         was dropped in r229831.
1687
1688         * UIProcess/WebPageProxy.cpp:
1689         (WebKit::WebPageProxy::receivedPolicyDecision):
1690
1691 2018-03-21  Wenson Hsieh  <wenson_hsieh@apple.com>
1692
1693         [Extra zoom mode] Add new SPI hooks for clients to vend an input session context view
1694         https://bugs.webkit.org/show_bug.cgi?id=183866
1695         <rdar://problem/38692256>
1696
1697         Reviewed by Tim Horton.
1698
1699         Add new SPI hooks to _WKInputDelegate allowing internal clients to provide a view that gives additional context
1700         when editing form controls, on top of the default label or placeholder text displayed by WebKit. The height
1701         delegate is invoked first, giving the client an opportunity to lay out the context view to fit the given size;
1702         the actual view is then queried.
1703
1704         If the view changes, clients may tell WebKit to reload the context view via SPI on WKFormInputSession; this call
1705         to reload is plumbed through to the currently presented list view controller (at the moment, this is only the
1706         text input list view controller).
1707
1708         * UIProcess/API/Cocoa/_WKFormInputSession.h:
1709         * UIProcess/API/Cocoa/_WKInputDelegate.h:
1710
1711         Add the new SPI hooks, described above.
1712
1713         * UIProcess/ios/WKContentViewInteraction.h:
1714         * UIProcess/ios/WKContentViewInteraction.mm:
1715         (-[WKFormInputSession reloadFocusedElementContextView]):
1716
1717         Plumb the context view reload hook through WKContentView to WKTextInputListViewController.
1718
1719         (-[WKContentView setupInteraction]):
1720         (-[WKContentView _stopAssistingNode]):
1721         (-[WKContentView reloadContextViewForPresentedListViewController]):
1722         (-[WKContentView focusedFormControllerDidUpdateSuggestions:]):
1723
1724         Slight tweak to only reload text suggestions if we are not blurring the focused element. Without this extra
1725         condition, the list view controller's inner table view would get reloaded when the form input session's text
1726         suggestions are set to nil when the list view controller is dismissed, causing a visible stutter in the
1727         dismissal animation of view controller.
1728
1729 2018-03-21  Chris Dumez  <cdumez@apple.com>
1730
1731         WebKitTestRunner crashed in com.apple.WebKit: WebKit::WebProcessPool::terminateServiceWorkerProcesses
1732         https://bugs.webkit.org/show_bug.cgi?id=183875
1733
1734         Reviewed by Brent Fulgham.
1735
1736         Protect |this| while we're iterating over m_serviceWorkerProcesses and terminating
1737         each service worker process. It is possible for the WebProcess pool to get destroyed
1738         as a result of terminating a service worker process.
1739
1740         This change is covered by layout tests that are currently crashing on the ASAN bots.
1741
1742         * UIProcess/WebProcessPool.cpp:
1743         (WebKit::WebProcessPool::terminateServiceWorkerProcesses):
1744
1745 2018-03-21  Eric Carlson  <eric.carlson@apple.com>
1746
1747         Fix typo in inactive media stream timeout default value
1748         https://bugs.webkit.org/show_bug.cgi?id=183872
1749         <rdar://problem/38723903>
1750
1751         Reviewed by Jer Noble.
1752
1753         * Shared/WebPreferences.yaml: Fix typo.
1754         * Shared/WebPreferencesDefaultValues.h: Ditto.
1755
1756 2018-03-21  Chris Dumez  <cdumez@apple.com>
1757
1758         Make policy decisions asynchronous
1759         https://bugs.webkit.org/show_bug.cgi?id=180568
1760         <rdar://problem/37131297>
1761
1762         Reviewed by Alex Christensen.
1763
1764         Get rid of synchronous IPC and synchronous code paths for policy delegates.
1765         Policy decisions are now all made asynchronously and rely on asynchronous
1766         IPC.
1767
1768         This code change is based on work by Alex Christensen.
1769
1770         * UIProcess/WebPageProxy.cpp:
1771         (WebKit::WebPageProxy::receivedPolicyDecision):
1772         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1773         (WebKit::WebPageProxy::decidePolicyForResponse):
1774         * UIProcess/WebPageProxy.h:
1775         * UIProcess/WebPageProxy.messages.in:
1776         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1777         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
1778         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1779
1780 2018-03-21  Chris Dumez  <cdumez@apple.com>
1781
1782         ScrollViewInsetTests.RestoreInitialContentOffsetAfterCrash API test is failing with async delegates
1783         https://bugs.webkit.org/show_bug.cgi?id=183787
1784
1785         Reviewed by Wenson Hsieh.
1786
1787         Without asynchronous policy delegates, when the client requests a navigation, we would:
1788         1. Do a synchronous navigation policy check
1789         2. If the client allows the navigation, start the provisional load
1790
1791         Starting the provisional load would freeze the layer tree until first meaningful
1792         layout via WebFrameLoaderClient::provisionalLoadStarted() -> WebPage::didStartPageTransition().
1793
1794         When constructing a WebView and then requesting a load right away. This would make sure
1795         we do not commit a layer tree for the initial about:blank page because the layer tree
1796         would be frozen until we have something meaningful to show for the following load.
1797
1798         However, with asynchronous policy delegates, we are able to do a layer tree commit
1799         during the asynchronous navigation policy check because the layer tree is not frozen
1800         yet (provisional load has not started) and the process is not stuck on synchronous
1801         IPC. When constructing a WebView and then requesting a load right away, this would
1802         allow a layer tree commit for about:blank to happen before we've even started the
1803         load. This would cause some API tests to fail on iOS.
1804
1805         To address the issue, we try and maintain pre-existing behavior by freezing the
1806         layer tree during navigation policy decision.
1807
1808         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1809         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1810         (WebKit::WebFrameLoaderClient::didDecidePolicyForNavigationAction):
1811         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1812         * WebProcess/WebPage/WebPage.cpp:
1813         (WebKit::WebPage::didStartNavigationPolicyCheck):
1814         (WebKit::WebPage::didCompleteNavigationPolicyCheck):
1815         * WebProcess/WebPage/WebPage.h:
1816
1817 2018-03-21  Brent Fulgham  <bfulgham@apple.com>
1818
1819         Allow the WebContent process to read ViewBridge preferences
1820         https://bugs.webkit.org/show_bug.cgi?id=183862
1821         <rdar://problem/38459456>
1822
1823         Reviewed by Eric Carlson.
1824
1825         * WebProcess/com.apple.WebProcess.sb.in:
1826
1827 2018-03-21  Frederic Wang  <fwang@igalia.com>
1828
1829         [iOS] Text highlighted by the Find UI overlaps with NBC news header on google.com
1830         https://bugs.webkit.org/show_bug.cgi?id=183658
1831
1832         Reviewed by Tim Horton.
1833
1834         On Mobile, many sites have overlay headers or footers that may overlap with the highlighted
1835         text inside a scrollable overflow node. To workaround that issue, this commit changes the
1836         behavior so that the text is revealed at the center of the overflow node.
1837
1838         * WebProcess/WebPage/ios/FindControllerIOS.mm:
1839         (WebKit::FindController::didFindString): Use alignCenterAlways instead of alignToEdgeIfNeeded.
1840
1841 2018-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1842
1843         [GTK][WPE] JSC bindings not introspectable
1844         https://bugs.webkit.org/show_bug.cgi?id=136989
1845
1846         Reviewed by Michael Catanzaro.
1847
1848         Deprecate the functions that are not introspectable due to JSC C API in GTK+ port and remove them in WPE
1849         port. Add alternative functions using the new JSC GLib API. We no longer need to keep a global context attached
1850         to every view. We can simply create a temporary global context on demand and release it after 1 second. This
1851         also allows us to remove WebPageProxy::javascriptGlobalContext() and all the related code.
1852
1853         * PlatformGTK.cmake:
1854         * PlatformWPE.cmake:
1855         * UIProcess/API/glib/WebKitJavascriptResult.cpp:
1856         (_WebKitJavascriptResult::_WebKitJavascriptResult):
1857         (webkitJavascriptResultCreate):
1858         (webkit_javascript_result_get_global_context):
1859         (webkit_javascript_result_get_value):
1860         (webkit_javascript_result_get_js_value):
1861         * UIProcess/API/glib/WebKitJavascriptResultPrivate.h:
1862         (SharedJavascriptContext::singleton):
1863         (SharedJavascriptContext::SharedJavascriptContext):
1864         (SharedJavascriptContext::getOrCreateContext):
1865         (SharedJavascriptContext::releaseContext):
1866         * UIProcess/API/glib/WebKitUserContentManager.cpp:
1867         * UIProcess/API/glib/WebKitWebView.cpp:
1868         (webkit_web_view_get_javascript_global_context):
1869         (webkitWebViewRunJavaScriptCallback):
1870         * UIProcess/API/gtk/PageClientImpl.cpp:
1871         * UIProcess/API/gtk/PageClientImpl.h:
1872         * UIProcess/API/gtk/WebKitJavascriptResult.h:
1873         * UIProcess/API/gtk/WebKitWebView.h:
1874         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1875         * UIProcess/API/wpe/APIViewClient.h:
1876         (API::ViewClient::handleDownloadRequest):
1877         * UIProcess/API/wpe/PageClientImpl.cpp:
1878         * UIProcess/API/wpe/PageClientImpl.h:
1879         * UIProcess/API/wpe/WPEView.cpp:
1880         * UIProcess/API/wpe/WPEView.h:
1881         * UIProcess/API/wpe/WebKitJavascriptResult.h:
1882         * UIProcess/API/wpe/WebKitWebView.h:
1883         * UIProcess/PageClient.h:
1884         * UIProcess/WebPageProxy.h:
1885         * UIProcess/gtk/WebPageProxyGtk.cpp:
1886         * UIProcess/wpe/WebPageProxyWPE.cpp:
1887         * WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp:
1888         (webkit_frame_get_js_context):
1889         (webkit_frame_get_js_context_for_script_world):
1890         * WebProcess/InjectedBundle/API/gtk/WebKitFrame.h:
1891         * WebProcess/InjectedBundle/API/wpe/WebKitFrame.h:
1892
1893 2018-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1894
1895         [GTK][WPE] Initial implementation of JavaScriptCore glib bindings
1896         https://bugs.webkit.org/show_bug.cgi?id=164061
1897
1898         Reviewed by Michael Catanzaro.
1899
1900         Set decorator and deprecation_guard options in API docs config files, since they are no longer common to all
1901         libraries.
1902
1903         * PlatformGTK.cmake:
1904
1905 2018-03-21  Zan Dobersek  <zdobersek@igalia.com>
1906
1907         [CoordGraphics] Simplify CoordinatedGraphicsScene activation
1908         https://bugs.webkit.org/show_bug.cgi?id=183772
1909
1910         Reviewed by Carlos Garcia Campos.
1911
1912         Simplify CoordinatedGraphicsScene::setActive() into a simple setter of
1913         the m_isActive member variable. We don't have to call renderNextFrame()
1914         anymore as that was only necessary to unblock CoordinatedLayerTreeHost,
1915         but that can be avoided if m_isWaitingForRenderer in that class is
1916         initialized to false.
1917
1918         CoordinatedGraphicsSceneClient::renderNextFrame() virtual method and its
1919         ThreadedCompositor implementation are removed. renderNextFrame() in the
1920         CoordinatedGraphicsScene class can also be removed, along with the
1921         unused dispatchOnMainThread() and dispatchOnClientRunLoop() methods and
1922         the associated m_clientRunLoop member variable.
1923
1924         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1925         (WebKit::CoordinatedGraphicsScene::CoordinatedGraphicsScene):
1926         (WebKit::CoordinatedGraphicsScene::dispatchOnMainThread): Deleted.
1927         (WebKit::CoordinatedGraphicsScene::dispatchOnClientRunLoop): Deleted.
1928         (WebKit::CoordinatedGraphicsScene::renderNextFrame): Deleted.
1929         (WebKit::CoordinatedGraphicsScene::setActive): Deleted.
1930         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1931         (WebKit::CoordinatedGraphicsSceneClient::~CoordinatedGraphicsSceneClient):
1932         (WebKit::CoordinatedGraphicsScene::setActive):
1933         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1934         (WebKit::m_displayRefreshMonitor):
1935         (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing):
1936         (WebKit::ThreadedCompositor::renderNextFrame): Deleted.
1937         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1938         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
1939
1940 2018-03-21  Zan Dobersek  <zdobersek@igalia.com>
1941
1942         [TexMap] Have TextureMapperLayer::applyAnimationsRecursively() return running animation status
1943         https://bugs.webkit.org/show_bug.cgi?id=183771
1944
1945         Reviewed by Carlos Garcia Campos.
1946
1947         In CoordinatedGraphicsScene::paintToCurrentGLContext(), retrieve
1948         information about any running animation in the scene via the
1949         TextureMapperLayer::applyAnimationsRecursively() call. Use that boolean
1950         value at the end up the method, instead of again traversing the
1951         TextureMapperLayer tree to determine whether any running animations are
1952         present.
1953
1954         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1955         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
1956
1957 2018-03-20  Tim Horton  <timothy_horton@apple.com>
1958
1959         Enable the minimal simulator feature flag when appropriate
1960         https://bugs.webkit.org/show_bug.cgi?id=183807
1961
1962         Reviewed by Dan Bernstein.
1963
1964         * Configurations/FeatureDefines.xcconfig:
1965
1966 2018-03-19  Ryosuke Niwa  <rniwa@webkit.org>
1967
1968         Expose content attributes on _WKLinkIconParameters
1969         https://bugs.webkit.org/show_bug.cgi?id=183768
1970
1971         Reviewed by Alex Christensen.
1972
1973         Added _WKLinkIconParameters.attributes to expose content attributes of a link element
1974         which defined a favicon, touch icon, or pre-compressed touch icon.
1975
1976         * UIProcess/API/Cocoa/_WKLinkIconParameters.h:
1977         (_WKLinkIconParameters.attributes): Added.
1978         * UIProcess/API/Cocoa/_WKLinkIconParameters.mm:
1979         (_WKLinkIconParameters._attributes): Added.
1980         (-[_WKLinkIconParameters _initWithLinkIcon:]): Convert the hash map from WebCore to a NSDictionary.
1981         (-[_WKLinkIconParameters attributes]): Added.
1982
1983 2018-03-20  Wenson Hsieh  <wenson_hsieh@apple.com>
1984
1985         Add AssistedNodeInformation plumbing for form control placeholder text and label text
1986         https://bugs.webkit.org/show_bug.cgi?id=183802
1987         <rdar://problem/38686273>
1988
1989         Reviewed by Tim Horton.
1990
1991         Surfaces some additional information about the currently focused element to the input delegate in the UI process.
1992         See comments below for more details.
1993
1994         Test: WebKit.FocusedElementInfo
1995
1996         * Shared/AssistedNodeInformation.cpp:
1997         (WebKit::AssistedNodeInformation::encode const):
1998         (WebKit::AssistedNodeInformation::decode):
1999         * Shared/AssistedNodeInformation.h:
2000
2001         Add `placeholder` and `label` to AssistedNodeInformation, which capture the value of the placeholder attribute
2002         and the text of the first associated label element for the focused form control. Also add boilerplate encoder/
2003         decoder support for these members.
2004
2005         * UIProcess/API/Cocoa/_WKFocusedElementInfo.h:
2006
2007         Augment _WKFocusedElementInfo to include placeholder and label.
2008
2009         * UIProcess/ios/WKContentViewInteraction.mm:
2010         (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]):
2011         (-[WKFocusedElementInfo label]):
2012         (-[WKFocusedElementInfo placeholder]):
2013         * WebProcess/WebPage/ios/WebPageIOS.mm:
2014         (WebKit::WebPage::getAssistedNodeInformation):
2015
2016         For input elements and textareas, set the placeholder to the value of the placeholder attribute. For all
2017         elements with associated labels, grab the inner text of the first label that is not empty, ignoring all labels
2018         that are `display: none` (i.e. not being rendered).
2019
2020 2018-03-20  Brady Eidson  <beidson@apple.com>
2021
2022         First piece of process swapping on navigation.
2023         https://bugs.webkit.org/show_bug.cgi?id=183665
2024
2025         Reviewed by Andy Estes.
2026
2027         This patch adds the first pieces of the following feature:
2028         "When a navigation originating inside a WKWebView goes to a different origin,
2029          swap to a new WebProcess for that navigation"
2030
2031         There are significant bugs to be resolved and significant optimizations to be made.
2032         Which is why the feature is disabled by default.
2033
2034         Besides the core logic implementing the feature, this patch does a lot of related 
2035         work such as:
2036         - Removing some now-invalid ASSERTs
2037         - Adding some ASSERTs
2038         - Update various switch states to handle the new "Suspend" policy and "NavigationSwap"
2039           process termination reason
2040
2041         * NetworkProcess/NetworkDataTaskBlob.cpp:
2042         (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse):
2043
2044         * NetworkProcess/capture/NetworkDataTaskReplay.cpp:
2045         (WebKit::NetworkCapture::NetworkDataTaskReplay::didReceiveResponse):
2046
2047         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2048         (toNSURLSessionResponseDisposition):
2049
2050         * Platform/Logging.h:
2051
2052         * Shared/LoadParameters.cpp:
2053         (WebKit::LoadParameters::encode const):
2054         (WebKit::LoadParameters::decode):
2055         * Shared/LoadParameters.h:
2056
2057         * Shared/ProcessTerminationReason.h: Add "NavigationSwap" as a process termination reason.
2058
2059         * UIProcess/API/APINavigation.h:
2060
2061         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2062         (API::ProcessPoolConfiguration::copy):
2063
2064         * UIProcess/API/C/WKAPICast.h:
2065         (WebKit::toAPI):
2066
2067         * UIProcess/Cocoa/NavigationState.mm:
2068         (WebKit::wkProcessTerminationReason):
2069
2070         * UIProcess/WebFramePolicyListenerProxy.cpp:
2071         (WebKit::WebFramePolicyListenerProxy::WebFramePolicyListenerProxy):
2072         * UIProcess/WebFramePolicyListenerProxy.h:
2073         (WebKit::WebFramePolicyListenerProxy::create):
2074         (WebKit::WebFramePolicyListenerProxy::policyListenerType const):
2075
2076         * UIProcess/WebFrameProxy.cpp:
2077         (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
2078         (WebKit::WebFrameProxy::activePolicyListenerProxy):
2079         * UIProcess/WebFrameProxy.h:
2080
2081         * UIProcess/WebNavigationState.cpp:
2082         (WebKit::WebNavigationState::navigation):
2083         (WebKit::WebNavigationState::takeNavigation):
2084
2085         * UIProcess/WebPageProxy.cpp:
2086         (WebKit::WebPageProxy::reattachToWebProcess):
2087         (WebKit::WebPageProxy::attachToProcessForNavigation): Pretend that the existing process 
2088           terminated using the new "NavigationSwap" reason, then manually start the next load.
2089         (WebKit::WebPageProxy::loadRequest):
2090         (WebKit::WebPageProxy::loadRequestWithNavigation):
2091         (WebKit::WebPageProxy::receivedPolicyDecision):
2092         (WebKit::WebPageProxy::continueNavigationInNewProcess):
2093         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2094         (WebKit::WebPageProxy::decidePolicyForResponse):
2095         (WebKit::WebPageProxy::processDidTerminate):
2096         (WebKit::WebPageProxy::resetState):
2097         (WebKit::WebPageProxy::resetStateAfterProcessExited):
2098         * UIProcess/WebPageProxy.h:
2099
2100         * UIProcess/WebProcessPool.cpp:
2101         (WebKit::WebProcessPool::processForNavigation): Determine which process should be used
2102           for a proposed navigation, creating a new one if necessary.
2103         * UIProcess/WebProcessPool.h:
2104
2105         * UIProcess/WebStorage/StorageManager.cpp:
2106         (WebKit::StorageManager::SessionStorageNamespace::setAllowedConnection):
2107
2108         * WebProcess/WebPage/WebPage.cpp:
2109         (WebKit::WebPage::loadRequest):
2110
2111 2018-03-20  Youenn Fablet  <youenn@apple.com>
2112
2113         ServiceWorkerClientFetch::didReceiveData should check for m_encodedDataLength
2114         https://bugs.webkit.org/show_bug.cgi?id=183668
2115
2116         Reviewed by Chris Dumez.
2117
2118         Crash happens when releasing a RefPtr<SharedBuffer> buffer that is null.
2119         It happens because ServiceWorkerClientFetch can call m_loader->didReceiveBuffer at two different places.
2120         Either when receiving an IPC call or as part of completion handler for the response validation check.
2121         At each call site, we release the buffer to pass it to the loader and we set m_encodedLength to zero.
2122         The fix is to add the m_encodedLength check like done in the case of response validation check completion handler.
2123
2124         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
2125         (WebKit::ServiceWorkerClientFetch::didReceiveData):
2126
2127 2018-03-20  Jeff Miller  <jeffm@apple.com>
2128
2129         Expose aggressiveTileRetentionEnabled in WKPreferences SPI to match C SPI
2130         https://bugs.webkit.org/show_bug.cgi?id=183790
2131
2132         Reviewed by Alex Christensen.
2133         
2134         Expose this property on macOS only.
2135
2136         * UIProcess/API/Cocoa/WKPreferences.mm:
2137         (-[WKPreferences _setAggressiveTileRetentionEnabled:]):
2138         (-[WKPreferences _aggressiveTileRetentionEnabled]):
2139         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2140
2141 2018-03-20  Tim Horton  <timothy_horton@apple.com>
2142
2143         Add and adopt WK_PLATFORM_NAME and adjust default feature defines
2144         https://bugs.webkit.org/show_bug.cgi?id=183758
2145         <rdar://problem/38017644>
2146
2147         Reviewed by Dan Bernstein.
2148
2149         * Configurations/FeatureDefines.xcconfig:
2150
2151 2018-03-20  Chris Dumez  <cdumez@apple.com>
2152
2153         Unreviewed, rolling out r229726 and r229763.
2154
2155         Caused some API test failures on iOS
2156
2157         Reverted changesets:
2158
2159         "Make policy decisions asynchronous"
2160         https://bugs.webkit.org/show_bug.cgi?id=180568
2161         https://trac.webkit.org/changeset/229726
2162
2163         "Rebaseline three webarchive tests for WK2 after r229726."
2164         https://bugs.webkit.org/show_bug.cgi?id=180568
2165         https://trac.webkit.org/changeset/229763
2166
2167 2018-03-20  Brent Fulgham  <bfulgham@apple.com>
2168
2169         [iOS] Grant IOKit preference access for the Home button
2170         https://bugs.webkit.org/show_bug.cgi?id=183754
2171         <rdar://problem/38179704>
2172
2173         Reviewed by Eric Carlson.
2174
2175         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2176
2177 2018-03-20  Wenson Hsieh  <wenson_hsieh@apple.com>
2178
2179         [Extra zoom mode] Adopt updated input view controller machinery for text input
2180         https://bugs.webkit.org/show_bug.cgi?id=183765
2181         <rdar://problem/36926269>
2182
2183         Reviewed by Tim Horton.
2184
2185         Adopt new classes for extra zoomed text inputs. Massage WKTextInputViewController into WKTextInputListView-
2186         Controller and introduce WKFormControlListViewController, the eventual replacement for the base class
2187         WKTextFormControlViewController that will act as the base class of all list-view-controller-based input UI in
2188         extra zoom mode.
2189
2190         * UIProcess/ios/WKContentViewInteraction.h:
2191         * UIProcess/ios/WKContentViewInteraction.mm:
2192         (-[WKContentView presentTextInputViewController:]):
2193         (-[WKContentView dismissTextInputViewController:]):
2194         (-[WKContentView focusedFormControllerDidUpdateSuggestions:]):
2195         (-[WKContentView _wheelChangedWithEvent:]):
2196         * UIProcess/ios/forms/WKFormControlListViewController.h: Copied from Source/WebKit/UIProcess/ios/forms/WKTextInputViewController.h.
2197         * UIProcess/ios/forms/WKFormControlListViewController.mm: Renamed from Source/WebKit/UIProcess/ios/forms/WKTextInputViewController.mm.
2198         * UIProcess/ios/forms/WKTextInputListViewController.h: Copied from Source/WebKit/UIProcess/ios/forms/WKTextInputViewController.h.
2199         * UIProcess/ios/forms/WKTextInputListViewController.mm: Renamed from Source/WebKit/UIProcess/ios/forms/WKTextInputViewController.h.
2200         * WebKit.xcodeproj/project.pbxproj:
2201
2202 2018-03-19  Megan Gardner  <megan_gardner@apple.com>
2203
2204         Clear style colors when setting default appearance
2205         https://bugs.webkit.org/show_bug.cgi?id=183759
2206
2207         Reviewed by Tim Horton.
2208
2209         Colors are cached and need to be cleared and recalculated.
2210
2211         * WebProcess/WebPage/WebPage.cpp:
2212         (WebKit::WebPage::setDefaultAppearance):
2213
2214 2018-03-19  Chris Dumez  <cdumez@apple.com>
2215
2216         WKWebView.ClearAppCache is a flaky API test failure on High Sierra.
2217         https://bugs.webkit.org/show_bug.cgi?id=181546
2218         <rdar://problem/36444327>
2219
2220         Reviewed by Ryosuke Niwa.
2221
2222         in LocalStorageDatabaseTracker::deleteDatabasesModifiedSince(), add origin
2223         to originIdentifiersToDelete if we cannot determine the last modification
2224         time of the database file. This likely means the database file does not
2225         exist. However, we still needs to make sure the origin gets removed from
2226         the origins database and there may be *.wal / *.shm variants of the database
2227         that are still on disk and need to be deleted.
2228
2229         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
2230         (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):
2231
2232 2018-03-19  Chris Dumez  <cdumez@apple.com>
2233
2234         Have one service worker process per security origin
2235         https://bugs.webkit.org/show_bug.cgi?id=183600
2236         <rdar://problem/35280128>
2237
2238         Reviewed by Brady Eidson.
2239
2240         Split service workers from different origins into their own processes
2241         for security reasons.
2242
2243         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2244         (WebKit::WebSWServerConnection::startFetch):
2245         (WebKit::WebSWServerConnection::postMessageToServiceWorker):
2246         (WebKit::WebSWServerConnection::scheduleJobInServer):
2247         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
2248         (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
2249         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
2250         * StorageProcess/StorageProcess.cpp:
2251         (WebKit::StorageProcess::connectionToContextProcessFromIPCConnection):
2252         (WebKit::StorageProcess::didClose):
2253         (WebKit::StorageProcess::connectionToContextProcessWasClosed):
2254         (WebKit::StorageProcess::needsServerToContextConnectionForOrigin const):
2255         (WebKit::StorageProcess::didReceiveMessage):
2256         (WebKit::StorageProcess::createStorageToWebProcessConnection):
2257         (WebKit::StorageProcess::serverToContextConnectionForOrigin):
2258         (WebKit::StorageProcess::createServerToContextConnection):
2259         * StorageProcess/StorageProcess.h:
2260         * StorageProcess/StorageProcess.messages.in:
2261         * StorageProcess/StorageToWebProcessConnection.cpp:
2262         (WebKit::StorageToWebProcessConnection::didReceiveMessage):
2263         (WebKit::StorageToWebProcessConnection::didClose):
2264         * StorageProcess/StorageToWebProcessConnection.h:
2265         * UIProcess/API/C/WKContext.cpp:
2266         (WKContextTerminateServiceWorkerProcess):
2267         * UIProcess/API/Cocoa/WKProcessPool.mm:
2268         (-[WKProcessPool _terminateServiceWorkerProcesses]):
2269         (-[WKProcessPool _webPageContentProcessCount]):
2270         (-[WKProcessPool _serviceWorkerProcessCount]):
2271         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2272         * UIProcess/Network/NetworkProcessProxy.cpp:
2273         (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
2274         (WebKit::NetworkProcessProxy::canAuthenticateAgainstProtectionSpace):
2275         * UIProcess/ServiceWorkerProcessProxy.cpp:
2276         (WebKit::ServiceWorkerProcessProxy::create):
2277         (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
2278         * UIProcess/ServiceWorkerProcessProxy.h:
2279         (isType):
2280         * UIProcess/Storage/StorageProcessProxy.cpp:
2281         (WebKit::StorageProcessProxy::getStorageProcessConnection):
2282         (WebKit::StorageProcessProxy::didFinishLaunching):
2283         (WebKit::StorageProcessProxy::establishWorkerContextConnectionToStorageProcess):
2284         (WebKit::StorageProcessProxy::establishWorkerContextConnectionToStorageProcessForExplicitSession):
2285         * UIProcess/Storage/StorageProcessProxy.h:
2286         * UIProcess/Storage/StorageProcessProxy.messages.in:
2287         * UIProcess/WebProcessPool.cpp:
2288         (WebKit::WebProcessPool::getStorageProcessConnection):
2289         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
2290         (WebKit::WebProcessPool::createNewWebProcess):
2291         (WebKit::WebProcessPool::disconnectProcess):
2292         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
2293         (WebKit::WebProcessPool::createWebPage):
2294         (WebKit::WebProcessPool::updateServiceWorkerUserAgent):
2295         (WebKit::WebProcessPool::mayHaveRegisteredServiceWorkers):
2296         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
2297         (WebKit::WebProcessPool::terminateServiceWorkerProcesses):
2298         (WebKit::WebProcessPool::updateProcessAssertions):
2299         (WebKit::WebProcessPool::serviceWorkerProcessProxyFromPageID const):
2300         * UIProcess/WebProcessPool.h:
2301         * UIProcess/WebProcessProxy.cpp:
2302         (WebKit::WebProcessProxy::getStorageProcessConnection):
2303
2304 2018-03-19  Jiewen Tan  <jiewen_tan@apple.com>
2305
2306         Unreviewed, another quick fix for r229699
2307
2308         Restricts ENABLE_WEB_AUTHN to only macOS and iOS.
2309
2310         * Configurations/FeatureDefines.xcconfig:
2311
2312 2018-03-19  Chris Dumez  <cdumez@apple.com>
2313
2314         Make policy decisions asynchronous
2315         https://bugs.webkit.org/show_bug.cgi?id=180568
2316         <rdar://problem/37131297>
2317
2318         Reviewed by Alex Christensen.
2319
2320         Get rid of synchronous IPC and synchronous code paths for policy delegates.
2321         Policy decisions are now all made asynchronously and rely on asynchronous
2322         IPC.
2323
2324         This code change is based on work by Alex Christensen.
2325
2326         * UIProcess/WebPageProxy.cpp:
2327         (WebKit::WebPageProxy::receivedPolicyDecision):
2328         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2329         (WebKit::WebPageProxy::decidePolicyForResponse):
2330         * UIProcess/WebPageProxy.h:
2331         * UIProcess/WebPageProxy.messages.in:
2332         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2333         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
2334         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2335
2336 2018-03-19  Brian Burg  <bburg@apple.com>
2337
2338         Web Inspector: clean up WKWebView configuration code
2339         https://bugs.webkit.org/show_bug.cgi?id=183747
2340         <rdar://problem/38629343>
2341
2342         Reviewed by Timothy Hatcher.
2343
2344         * UIProcess/mac/WKInspectorViewController.mm:
2345         (-[WKInspectorViewController webView]): Always use system
2346         appearance for Inspector's web content.
2347
2348 2018-03-19  Eric Carlson  <eric.carlson@apple.com>
2349
2350         [Extra zoom mode] Require fullscreen for video playback
2351         https://bugs.webkit.org/show_bug.cgi?id=183742
2352         <rdar://problem/38235862>
2353
2354         Reviewed by Jer Noble.
2355
2356         * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
2357         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
2358         (-[WKVideoFullScreenViewController initWithAVPlayerViewController:]):
2359         (-[WKVideoFullScreenViewController viewDidLoad]):
2360         (-[WKVideoFullScreenViewController prefersStatusBarHidden]):
2361         (WebKit::VideoFullscreenModelContext::presentingViewController):
2362         (WebKit::VideoFullscreenModelContext::createVideoFullscreenViewController):
2363         * WebProcess/cocoa/VideoFullscreenManager.mm:
2364         (WebKit::VideoFullscreenManager::didEnterFullscreen):
2365
2366 2018-03-19  Daniel Bates  <dabates@apple.com>
2367
2368         test-webkitpy no longer runs WebKit2 tests
2369         https://bugs.webkit.org/show_bug.cgi?id=183724
2370
2371         Reviewed by Alexey Proskuryakov.
2372
2373         Fixes an issue where Python emits errors "global name reset_results is not defined" when
2374         running tests in messages_unittest.py using test-webkitpy.
2375
2376         Currently messages_unittest.py conditionally defines the global variable reset_results
2377         when run as the main program (i.e. __name__ == "__main__"). When messages_unittest.py is
2378         imported as a module as test-webkitpy does then it is not considered the main program
2379         ;=> the top-level script environment is not __main__ ;=> we do not define the global
2380         variable reset_results. Instead we should unconditionally define the global variable
2381         reset_results.
2382
2383         * Scripts/webkit/messages_unittest.py:
2384
2385 2018-03-19  Per Arne Vollan  <pvollan@apple.com>
2386
2387         When the WebContent process is blocked from accessing the WindowServer, the call CVDisplayLinkCreateWithCGDisplay will fail.
2388         https://bugs.webkit.org/show_bug.cgi?id=183604
2389         <rdar://problem/38305109>
2390
2391         Reviewed by Brent Fulgham.
2392
2393         * UIProcess/WebPageProxy.h:
2394         * UIProcess/WebPageProxy.messages.in:
2395         * UIProcess/mac/DisplayLink.cpp: Added.
2396         (WebKit::DisplayLink::DisplayLink):
2397         (WebKit::DisplayLink::~DisplayLink):
2398         (WebKit::DisplayLink::displayLinkCallback):
2399         * UIProcess/mac/DisplayLink.h: Added.
2400         * UIProcess/mac/WebPageProxyMac.mm:
2401         (WebKit::WebPageProxy::startDisplayRefreshMonitor):
2402         (WebKit::WebPageProxy::stopDisplayRefreshMonitor):
2403         * WebKit.xcodeproj/project.pbxproj:
2404         * WebProcess/WebPage/DrawingArea.cpp:
2405         (WebKit::DrawingArea::createDisplayRefreshMonitor):
2406         * WebProcess/WebPage/DrawingArea.h:
2407         * WebProcess/WebPage/DrawingArea.messages.in:
2408         * WebProcess/WebPage/mac/DrawingAreaMac.cpp: Added.
2409         (WebKit::DisplayRefreshMonitorMac::create):
2410         (WebKit::DisplayRefreshMonitorMac::DisplayRefreshMonitorMac):
2411         (WebKit::DisplayRefreshMonitorMac::~DisplayRefreshMonitorMac):
2412         (WebKit::DisplayRefreshMonitorMac::requestRefreshCallback):
2413         (WebKit::DisplayRefreshMonitorMac::displayLinkFired):
2414         (WebKit::DrawingArea::screenWasRefreshed):
2415         (WebKit::DrawingArea::createDisplayRefreshMonitor):
2416
2417 2018-03-17  Jiewen Tan  <jiewen_tan@apple.com>
2418
2419         [WebAuthN] Implement authenticatorMakeCredential
2420         https://bugs.webkit.org/show_bug.cgi?id=183527
2421         <rdar://problem/35275886>
2422
2423         Reviewed by Brent Fulgham.
2424
2425         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp:
2426         (WebKit::WebCredentialsMessengerProxy::WebCredentialsMessengerProxy):
2427         (WebKit::WebCredentialsMessengerProxy::makeCredential):
2428         (WebKit::WebCredentialsMessengerProxy::getAssertion):
2429         (WebKit::WebCredentialsMessengerProxy::isUserVerifyingPlatformAuthenticatorAvailable):
2430         (WebKit::WebCredentialsMessengerProxy::exceptionReply):
2431         (WebKit::WebCredentialsMessengerProxy::makeCredentialReply):
2432         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h:
2433         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in:
2434         * UIProcess/CredentialManagement/cocoa/WebCredentialsMessengerProxyCocoa.mm: Removed.
2435         * WebKit.xcodeproj/project.pbxproj:
2436         * WebProcess/CredentialManagement/WebCredentialsMessenger.cpp:
2437         (WebKit::WebCredentialsMessenger::makeCredential):
2438         (WebKit::WebCredentialsMessenger::makeCredentialReply):
2439         * WebProcess/CredentialManagement/WebCredentialsMessenger.h:
2440         * WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in:
2441
2442 2018-03-17  Daniel Bates  <dabates@apple.com>
2443
2444         Tests fail in messages_unittest.py
2445         https://bugs.webkit.org/show_bug.cgi?id=183725
2446
2447         Partial revert of r222113. The messages generator machinery does not know when
2448         it is sufficient to emit an include for wtf/Forward.h as opposed to a concrete
2449         header.
2450
2451         * Scripts/webkit/LegacyMessages-expected.h:
2452         * Scripts/webkit/Messages-expected.h:
2453
2454 2018-03-16  Wenson Hsieh  <wenson_hsieh@apple.com>
2455
2456         Unreviewed, rolling out r229688.
2457
2458         There's a solution that doesn't require this SPI.
2459
2460         Reverted changeset:
2461
2462         "Add SPI to expose width and height anchors for WKWebView's
2463         content view"
2464         https://bugs.webkit.org/show_bug.cgi?id=183711
2465         https://trac.webkit.org/changeset/229688
2466
2467 2018-03-16  Wenson Hsieh  <wenson_hsieh@apple.com>
2468
2469         Add SPI to expose width and height anchors for WKWebView's content view
2470         https://bugs.webkit.org/show_bug.cgi?id=183711
2471         <rdar://problem/38562899>
2472
2473         Reviewed by Tim Horton.
2474
2475         Add _contentWidthAnchor and _contentHeightAnchor SPI to WKWebView for internal clients to be able to reason
2476         about the size of the content view on iOS using autolayout.
2477
2478         Test: WebKit.AutoLayoutPositionHeaderAndFooterViewsInScrollView.
2479
2480         * UIProcess/API/Cocoa/WKWebView.mm:
2481         (-[WKWebView _contentWidthAnchor]):
2482         (-[WKWebView _contentHeightAnchor]):
2483         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2484
2485 2018-03-16  Megan Gardner  <megan_gardner@apple.com>
2486
2487         Add _useSystemAppearance to WKView
2488         https://bugs.webkit.org/show_bug.cgi?id=183706
2489         <rdar://problem/38516584>
2490
2491         Reviewed by Tim Horton.
2492
2493         Plumb useSystemAppearance and other supporting functions to WKView
2494
2495         * UIProcess/API/Cocoa/WKViewPrivate.h:
2496         * UIProcess/API/Cocoa/WKWebView.mm:
2497         (-[WKWebView _initializeWithConfiguration:]):
2498         (-[WKWebView _useSystemAppearance]):
2499         (-[WKWebView _setUseSystemAppearance:]):
2500         (-[WKWebView effectiveAppearanceDidChange]):
2501         * UIProcess/API/mac/WKView.mm:
2502         (-[WKView effectiveAppearanceDidChange]):
2503         (-[WKView _setUseSystemAppearance:]):
2504         (-[WKView _useSystemAppearance]):
2505         (-[WKView _setDefaultAppearance:]):
2506         * UIProcess/Cocoa/WebViewImpl.h:
2507         * UIProcess/Cocoa/WebViewImpl.mm:
2508         (WebKit::WebViewImpl::setUseSystemAppearance):
2509         (WebKit::WebViewImpl::useSystemAppearance):
2510         (WebKit::WebViewImpl::setDefaultAppearance):
2511
2512 2018-03-16  Brent Fulgham  <bfulgham@apple.com>
2513
2514         Set a trap to catch an infrequent form-related nullptr crash
2515         https://bugs.webkit.org/show_bug.cgi?id=183704
2516         <rdar://problem/37579354>
2517
2518         Reviewed by Ryosuke Niwa.
2519
2520         Add a RELEASE_ASSERT to see if we ever encounter a nullptr WebCore frame.
2521
2522         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2523         (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):
2524
2525 2018-03-16  Jer Noble  <jer.noble@apple.com>
2526
2527         Make Fullscreen API an Experimental Feature
2528         https://bugs.webkit.org/show_bug.cgi?id=183662
2529
2530         Reviewed by Jon Lee.
2531
2532         Add the ability to have a conditional for whether an Experimental Feature is "visible", separate from
2533         whether the preference is available, for definining platform-specific Experimental Features.
2534
2535         * Scripts/GeneratePreferences.rb:
2536         * Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:
2537         * Shared/WebPreferences.yaml:
2538
2539 2018-03-16  Megan Gardner  <megan_gardner@apple.com>
2540
2541         Ensure that style is updated when the effective appearance changes
2542         https://bugs.webkit.org/show_bug.cgi?id=183690
2543         <rdar://problem/38385900>
2544
2545         Reviewed by Tim Horton and Wenson Hsieh.
2546
2547         Respond to and respect the effective appearance changing.
2548
2549         * UIProcess/API/Cocoa/WKWebView.mm:
2550         (-[WKWebView effectiveAppearanceDidChange]):
2551         * WebProcess/WebPage/WebPage.cpp:
2552         (WebKit::WebPage::setDefaultAppearance):
2553
2554 2018-03-16  Chris Dumez  <cdumez@apple.com>
2555
2556         URLSchemeHandler.Basic API test fails with async policy delegates
2557         https://bugs.webkit.org/show_bug.cgi?id=183678
2558
2559         Reviewed by Alex Christensen.
2560
2561         The issue is that the client calls _didPerformRedirection / didReceiveResponse / didReceiveData / didFinish
2562         on the URLScheme task one after the one, synchronously. However, redirects and responses can be processed
2563         asynchronously. To address the issue, we now queue operations requested by the client if we're waiting
2564         for an async policy delegate.
2565
2566         * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
2567         (WebKit::WebURLSchemeTaskProxy::didPerformRedirection):
2568         (WebKit::WebURLSchemeTaskProxy::didReceiveResponse):
2569         (WebKit::WebURLSchemeTaskProxy::didReceiveData):
2570         (WebKit::WebURLSchemeTaskProxy::didComplete):
2571         (WebKit::WebURLSchemeTaskProxy::processNextPendingTask):
2572         * WebProcess/WebPage/WebURLSchemeTaskProxy.h:
2573         (WebKit::WebURLSchemeTaskProxy::queueTask):
2574
2575 2018-03-16  Claudio Saavedra  <csaavedra@igalia.com>
2576
2577         Suppress GCC warnings by using #include instead of #import
2578
2579         Unreviewed.
2580         * UIProcess/SystemPreviewController.cpp:
2581
2582 2018-03-15  Keith Rollin  <krollin@apple.com>
2583
2584         Telemetry for stalled webpage loads
2585         https://bugs.webkit.org/show_bug.cgi?id=183221
2586         <rdar://problem/36549013>
2587
2588         Reviewed by Chris Dumez.
2589
2590         Add telemetry for page loads, tracking the pages that succeed, fail,
2591         or are canceled. This information will be used to track the overall
2592         health of our page loading as time goes on.
2593
2594         * UIProcess/WebPageProxy.cpp:
2595         (WebKit::WebPageProxy::close):
2596         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
2597         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
2598         (WebKit::WebPageProxy::didFinishLoadForFrame):
2599         (WebKit::WebPageProxy::didFailLoadForFrame):
2600         (WebKit::WebPageProxy::reportPageLoadResult):
2601         * UIProcess/WebPageProxy.h:
2602         (WebKit::WebPageProxy::reportPageLoadResult):
2603
2604 2018-03-15  Wenson Hsieh  <wenson_hsieh@apple.com>
2605
2606         [iOS WK2] Hit-testing fails when specifying a large top content inset
2607         https://bugs.webkit.org/show_bug.cgi?id=183648
2608         <rdar://problem/38421894>
2609
2610         Reviewed by Tim Horton.
2611
2612         Currently, in the process of computing unobscured content rect in the UI process on iOS, we subtract away parts
2613         of the view that are obscured by insets (e.g. MobileSafari's chrome). The helper method -[WKWebView
2614         _computeContentInset] is intended to compute these obscuring insets around the view, but it takes scroll view
2615         insets into account. This means that if WKWebView's inner scroll view has content insets, we'll end up shrinking
2616         the unobscured content rect as if the insetted region obscures the viewport; this causes visible content on the
2617         page to be uninteractible, since WKWebView erroneously thinks it's obscured.
2618
2619         To address this, we rename _computeContentInset to _computeObscuredInset, and make it _not_ affected by the
2620         scroll view's content insets. From code inspection and testing, all but one of the former call sites of
2621         _computeContentInset really need the obscured inset instead (see below). The one exception, -[WKWebView
2622         _adjustedContentOffset:], takes a scroll position from the page and maps it to a content offset in the inner
2623         UIScrollView (see below for more details).
2624
2625         Tests:  ScrollViewInsetTests.InnerHeightWithLargeTopContentInset
2626                 ScrollViewInsetTests.InnerHeightWithLargeBottomContentInset
2627                 ScrollViewInsetTests.RestoreInitialContentOffsetAfterCrash
2628                 ScrollViewInsetTests.RestoreInitialContentOffsetAfterNavigation
2629
2630         * UIProcess/API/Cocoa/WKWebView.mm:
2631         (-[WKWebView _setHasCustomContentView:loadedMIMEType:]):
2632         (-[WKWebView _initialContentOffsetForScrollView]):
2633
2634         See -_contentOffsetAdjustedForObscuredInset: below.
2635
2636         (-[WKWebView _contentOffsetAdjustedForObscuredInset:]):
2637
2638         Formerly -_adjustedContentOffset:. -_contentOffsetAdjustedForObscuredInset: no longer takes scroll view content
2639         inset into account, and only cares about insets that obscure the view. This means that the scroll position
2640         (0, 0) in the document now maps to the content offset in the inner UIScrollView, such that the top of the page
2641         is aligned with the top of the viewport.
2642
2643         However, many call sites of -_adjustedContentOffset: were intended to compute the initial, top-left-most content
2644         offset in the scroll view to scroll to when resetting the web view (i.e., they pass in CGPointZero for the
2645         scroll position). An example of this is the scroll position to jump to after web content process termination, or
2646         the scroll position after main frame navigation. In these cases, we actually want to jump to the top of the
2647         scroll view, so we do want to use the version of the computed content insets that accounts for scroll view
2648         insets.
2649
2650         Since these cases are limited to finding the top-left-most scroll position, we pull this out into a separate
2651         helper method (-_initialContentOffsetForScrollView) and replace calls to
2652         `-[self _adjustedContentOffset:CGPointZero]` with this instead.
2653
2654         (-[WKWebView _computedObscuredInset]):
2655
2656         A version of -_computeContentInset that doesn't care about scroll view insets. Used whereever we need to account
2657         for obscured insets rather than the combination of content insets and unobscured insets (e.g.
2658         -_initialContentOffsetForScrollView).
2659
2660         (-[WKWebView _processDidExit]):
2661         (-[WKWebView _didCommitLayerTree:]):
2662         (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]):
2663         (-[WKWebView _scrollToContentScrollPosition:scrollOrigin:]):
2664         (-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
2665         (-[WKWebView _updateVisibleContentRects]):
2666         (-[WKWebView _navigationGestureDidBegin]):
2667
2668         In all these places where we inset the view bounds to compute the unobscured region of the viewport, it doesn't
2669         make sense to additionally inset by the scroll view's content insets, since (1) the scroll view's content insets
2670         don't obscure the viewport, and (2) it's perfectly valid for the inner scroll view to have arbitrarily large
2671         content insets.
2672
2673         (-[WKWebView _adjustedContentOffset:]): Deleted.
2674
2675         Renamed to -_contentOffsetAdjustedForObscuredInset:.
2676
2677         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2678         * UIProcess/ios/WKPDFView.mm:
2679         (-[WKPDFView _offsetForPageNumberIndicator]):
2680
2681         Similar to -_scrollToFragment: (see below).
2682
2683         (-[WKPDFView _scrollToFragment:]):
2684
2685         This helper figures out which content offset to scroll to, given the y-origin of a page in a PDF document. If
2686         insets are added to the scroll view, we end up scrolling to the wrong content offset since we'll add the height
2687         of the top content inset (imagine that the top content inset is enormous — then we'll scroll an amount equal to
2688         the top content inset _past_ the point where the y-origin of the page is at the top of the viewport).
2689
2690 2018-03-15  Brent Fulgham  <bfulgham@apple.com>
2691
2692         [macOS] Correct sandbox violations during Flash playback under ToT WebKit
2693         https://bugs.webkit.org/show_bug.cgi?id=183672
2694         <rdar://problem/38510839>
2695
2696         Reviewed by Eric Carlson.
2697
2698         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
2699         * WebProcess/com.apple.WebProcess.sb.in:
2700
2701 2018-03-15  Brent Fulgham  <bfulgham@apple.com>
2702
2703         REGRESSION(r229484): Plugins often require CGS Connections to draw
2704         https://bugs.webkit.org/show_bug.cgi?id=183663
2705         <rdar://problem/38439218>
2706
2707         Reviewed by Per Arne Vollan.
2708
2709         Flash requires an active CGSConnection to work properly. Since we don't want the WebContent
2710         process to have on, create a new plugin process-specific layer host creation method that
2711         gives this access.
2712
2713         * Platform/mac/LayerHostingContext.h:
2714         * Platform/mac/LayerHostingContext.mm:
2715         (WebKit::LayerHostingContext::createForExternalPluginHostingProcess): Added.
2716         * PluginProcess/mac/PluginControllerProxyMac.mm:
2717         (WebKit::PluginControllerProxy::updateLayerHostingContext): Use the new creation
2718         method.
2719
2720 2018-03-15  Zan Dobersek  <zdobersek@igalia.com>
2721
2722         [TexMap] Remove TextureMapperLayer::texture()
2723         https://bugs.webkit.org/show_bug.cgi?id=183635
2724
2725         Reviewed by Michael Catanzaro.
2726
2727         Remove the CoordinatedBackingStore::texture() override since the virtual
2728         method is also being removed.
2729
2730         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
2731         (WebKit::CoordinatedBackingStore::texture const): Deleted.
2732         * Shared/CoordinatedGraphics/CoordinatedBackingStore.h:
2733
2734 2018-03-14  John Wilander  <wilander@apple.com>
2735
2736         Resource Load Statistics: Add clearing of storage access to WebResourceLoadStatisticsStore::clearInMemory()
2737         https://bugs.webkit.org/show_bug.cgi?id=183641
2738         <rdar://problem/38469497>
2739
2740         Reviewed by Brent Fulgham and Chris Dumez.
2741
2742         This change is to stabilize existing layout tests by removing
2743         all storage access entries on a call to 
2744         WebResourceLoadStatisticsStore::clearInMemory().
2745         See Ryan Haddad's comment in https://bugs.webkit.org/show_bug.cgi?id=183620.
2746
2747         Almost all of the code changes are piping to get this
2748         call from the WebResourceLoadStatisticsStore to
2749         WebCore::NetworkStorageSession where entries reside.
2750
2751         * NetworkProcess/NetworkProcess.cpp:
2752         (WebKit::NetworkProcess::removeAllStorageAccess):
2753         * NetworkProcess/NetworkProcess.h:
2754         * NetworkProcess/NetworkProcess.messages.in:
2755         * UIProcess/Network/NetworkProcessProxy.cpp:
2756         (WebKit::NetworkProcessProxy::removeAllStorageAccess):
2757         * UIProcess/Network/NetworkProcessProxy.h:
2758         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2759         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
2760         (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
2761         (WebKit::WebResourceLoadStatisticsStore::clearInMemory):
2762             Now also clears all storage access entries in the network process.
2763         * UIProcess/WebResourceLoadStatisticsStore.h:
2764         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2765         (WebKit::WebsiteDataStore::removeAllStorageAccessHandler):
2766         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
2767         * UIProcess/WebsiteData/WebsiteDataStore.h:
2768
2769 2018-03-14  Ryan Haddad  <ryanhaddad@apple.com>
2770
2771         Unreviewed, rolling out r229613.
2772
2773         Caused API test failures
2774
2775         Reverted changeset:
2776
2777         "Make policy decisions asynchronous"
2778         https://bugs.webkit.org/show_bug.cgi?id=180568
2779         https://trac.webkit.org/changeset/229613
2780
2781 2018-03-14  Chris Dumez  <cdumez@apple.com>
2782
2783         Reduce use of SWServerToContextConnection::globalServerToContextConnection()
2784         https://bugs.webkit.org/show_bug.cgi?id=183626
2785
2786         Reviewed by Youenn Fablet.
2787
2788         Reduce use of SWServerToContextConnection::globalServerToContextConnection() as we are moving
2789         towards having multiple context connections.
2790
2791         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2792         (WebKit::WebSWServerConnection::startFetch):
2793         (WebKit::WebSWServerConnection::postMessageToServiceWorker):
2794
2795 2018-03-14  Chris Dumez  <cdumez@apple.com>
2796
2797         Make policy decisions asynchronous
2798         https://bugs.webkit.org/show_bug.cgi?id=180568
2799         <rdar://problem/37131297>
2800
2801         Reviewed by Alex Christensen.
2802
2803         Get rid of synchronous IPC and synchronous code paths for policy delegates.
2804         Policy decisions are now all made asynchronously and rely on asynchronous
2805         IPC.
2806
2807         This code change is based on work by Alex Christensen.
2808
2809         * UIProcess/WebPageProxy.cpp:
2810         (WebKit::WebPageProxy::receivedPolicyDecision):
2811         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2812         (WebKit::WebPageProxy::decidePolicyForResponse):
2813         * UIProcess/WebPageProxy.h:
2814         * UIProcess/WebPageProxy.messages.in:
2815         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2816         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
2817         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2818
2819 2018-03-14  Chris Dumez  <cdumez@apple.com>
2820
2821         Drop unnecessary StorageToWebProcessConnection::workerContextProcessConnectionCreated()
2822         https://bugs.webkit.org/show_bug.cgi?id=183624
2823
2824         Reviewed by Youenn Fablet.
2825
2826         Drop unnecessary StorageToWebProcessConnection::workerContextProcessConnectionCreated()
2827         since it was going through all SWServers. Calling workerContextProcessConnectionCreated()
2828         on every StorageToWebProcessConnection was thus doing redundant work.
2829
2830         * StorageProcess/StorageProcess.cpp:
2831         (WebKit::StorageProcess::createStorageToWebProcessConnection):
2832         * StorageProcess/StorageToWebProcessConnection.cpp:
2833         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
2834         (WebKit::StorageToWebProcessConnection::workerContextProcessConnectionCreated): Deleted.
2835         * StorageProcess/StorageToWebProcessConnection.h:
2836
2837 2018-03-14  Tim Horton  <timothy_horton@apple.com>
2838
2839         Fix the build after r229567
2840
2841         * Configurations/FeatureDefines.xcconfig:
2842
2843 2018-03-13  John Wilander  <wilander@apple.com>
2844
2845         Resource Load Statistics: Immediately forward cookie access for domains with previous user interaction when there's an opener document
2846         https://bugs.webkit.org/show_bug.cgi?id=183620
2847         <rdar://problem/38431469>
2848
2849         Reviewed by Brent Fulgham.
2850
2851         It turns out the fix in https://bugs.webkit.org/show_bug.cgi?id=183577
2852         wasn't enough to address the compatibility issues with popups. Some of
2853         them just detect their unpartitioned cookies, auto-dismiss themselves,
2854         and expect their unpartitioned cookies to be available under the opener
2855         afterwards. We should grant them access if the popup's domain has had
2856         user interaction _previously_.
2857
2858         Note that we still need https://bugs.webkit.org/show_bug.cgi?id=183577
2859         because if the popup's domain has not received user interaction
2860         previously, we will not grant it storage access on just the window open.
2861
2862         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2863         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
2864         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccessUnderOpener): Deleted.
2865             Renamed WebResourceLoadStatisticsStore::grantStorageAccessUnderOpener()
2866             to WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener()
2867             since there is now a case where access will not be granted, i.e. when
2868             the popup domain has not had user interaction previously.
2869         * UIProcess/WebResourceLoadStatisticsStore.h:
2870         * UIProcess/WebResourceLoadStatisticsStore.messages.in:
2871              Similar renaming.
2872         * WebProcess/WebProcess.cpp:
2873         (WebProcess::WebProcess):
2874              Similar renaming.
2875
2876 2018-03-13  Jer Noble  <jer.noble@apple.com>
2877
2878         Add missing artwork for fullscreen mode.
2879         https://bugs.webkit.org/show_bug.cgi?id=183618
2880
2881         Reviewed by Jon Lee.
2882
2883         * Resources/ios/iOS.xcassets/Done.imageset/Contents.json: Added.
2884         * Resources/ios/iOS.xcassets/Done.imageset/Done.pdf: Added.
2885         * Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/Contents.json: Added.
2886         * Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/StartPictureInPictureButton@1x.png: Added.
2887         * Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/StartPictureInPictureButton@2x.png: Added.
2888         * Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/StartPictureInPictureButton@3x.png: Added.
2889         * Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/Contents.json: Added.
2890         * Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/StopPictureInPictureButton@1x.png: Added.
2891         * Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/StopPictureInPictureButton@2x.png: Added.
2892         * Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/StopPictureInPictureButton@3x.png: Added.
2893
2894 2018-03-13  Brian Burg  <bburg@apple.com>
2895
2896         [WK2] Web Inspector: NavigationAction for opening a link in a new tab should have a UserGestureIndicator
2897         https://bugs.webkit.org/show_bug.cgi?id=183612
2898         <rdar://problem/38388641>
2899
2900         Reviewed by Timothy Hatcher.
2901
2902         The current gesture token will be attached to the NavigationAction at construction time,
2903         so set up a UserGestureIndicator when creating the action and sending it out.
2904
2905         * WebProcess/WebPage/WebInspector.cpp:
2906         (WebKit::WebInspector::openInNewTab):
2907
2908 2018-03-13  Dean Jackson  <dino@apple.com>
2909
2910         WKSystemPreviewView needs to implement some of UIScrollViewDelegate
2911         https://bugs.webkit.org/show_bug.cgi?id=183607
2912         <rdar://problem/38427622>
2913
2914         Reviewed by Antoine Quint.
2915
2916         Add an empty implementation of scrollViewDidScroll.
2917
2918         * UIProcess/ios/WKSystemPreviewView.mm:
2919         (-[WKSystemPreviewView scrollViewDidScroll:]):
2920
2921 2018-03-13  Jiewen Tan  <jiewen_tan@apple.com>
2922
2923         Soft-link LocalAuthentication.Framework
2924         https://bugs.webkit.org/show_bug.cgi?id=183587
2925         <rdar://problem/38219763>
2926
2927         Reviewed by Brian Burg.
2928
2929         * UIProcess/CredentialManagement/cocoa/WebCredentialsMessengerProxyCocoa.mm:
2930         (WebKit::WebCredentialsMessengerProxy::platformIsUserVerifyingPlatformAuthenticatorAvailable):
2931         * WebKit.xcodeproj/project.pbxproj:
2932
2933 2018-03-12  Dean Jackson  <dino@apple.com>
2934
2935         Add a WKWebViewContentProvider for system previews
2936         https://bugs.webkit.org/show_bug.cgi?id=183582
2937         <rdar://problem/38393569>
2938
2939         Reviewed by Tim Horton.
2940
2941         Implement WKSystemPreviewView, which conforms to WKWebViewContentProvider, in
2942         order to view content as a "system preview". This effectively replaces the
2943         SystemPreviewController, which will be removed soon.
2944
2945         Some of the required methods of WKWebViewContentProvider are not necessary on
2946         this instance, so a follow-up patch will clean the protocol up a bit.
2947
2948         * UIProcess/Cocoa/NavigationState.mm: Don't trigger a SystemPreview when downloading.
2949         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
2950
2951         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
2952         (-[WKWebViewContentProviderRegistry init]): Register the WKSystemPreviewView for
2953         MIME types retrieved from WebKitAdditions.
2954
2955         * UIProcess/ios/WKSystemPreviewView.h: Added.
2956         * UIProcess/ios/WKSystemPreviewView.mm: Added.
2957
2958         (-[WKSystemPreviewView web_initWithFrame:webView:]):
2959         (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]): This is the
2960         method that actually creates a QuickLook preview and provides the data.
2961         (-[WKSystemPreviewView web_setMinimumSize:]):
2962         (-[WKSystemPreviewView web_setOverlaidAccessoryViewsInset:]):
2963         (-[WKSystemPreviewView web_computedContentInsetDidChange]):
2964         (-[WKSystemPreviewView web_setFixedOverlayView:]):
2965         (-[WKSystemPreviewView web_didSameDocumentNavigation:]):
2966         (-[WKSystemPreviewView web_countStringMatches:options:maxCount:]):
2967         (-[WKSystemPreviewView web_findString:options:maxCount:]):
2968         (-[WKSystemPreviewView web_hideFindUI]):
2969
2970         (-[WKSystemPreviewView numberOfPreviewItemsInPreviewController:]): QuickLook delegates.
2971         (-[WKSystemPreviewView previewController:previewItemAtIndex:]):
2972         (-[WKSystemPreviewView provideDataForItem:]):
2973         (-[WKSystemPreviewView previewControllerWillDismiss:]):
2974
2975         * WebKit.xcodeproj/project.pbxproj: Add new files.
2976
2977 2018-03-12  John Wilander  <wilander@apple.com>
2978
2979         Resource Load Statistics: Immediately forward cookie access at user interaction when there's an opener document
2980         https://bugs.webkit.org/show_bug.cgi?id=183577
2981         <rdar://problem/38266987>
2982
2983         Reviewed by Brent Fulgham.
2984
2985         * NetworkProcess/NetworkProcess.cpp:
2986         (WebKit::NetworkProcess::hasStorageAccessForFrame):
2987             Now also checks for general page access.
2988         (WebKit::NetworkProcess::grantStorageAccess):
2989             Renamed from grantStorageAccessForFrame since the frameID now is optional.
2990         (WebKit::NetworkProcess::grantStorageAccessForFrame): Deleted.
2991             Renamed since the frameID now is optional.
2992         * NetworkProcess/NetworkProcess.h:
2993             Renaming since the frameID now is optional.
2994         * NetworkProcess/NetworkProcess.messages.in:
2995             Renaming since the frameID now is optional.
2996         * NetworkProcess/NetworkResourceLoader.cpp:
2997         (WebKit::NetworkResourceLoader::logCookieInformation):
2998             Consequence of function renaming.
2999         * UIProcess/Network/NetworkProcessProxy.cpp:
3000         (WebKit::NetworkProcessProxy::grantStorageAccess):
3001         (WebKit::NetworkProcessProxy::grantStorageAccessForFrame): Deleted.
3002             Renaming since the frameID now is optional.
3003         * UIProcess/Network/NetworkProcessProxy.h:
3004         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3005         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
3006             Renaming since the frameID now is optional.
3007         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
3008             Handler renaming since the frameID now is optional.
3009         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccessUnderOpener):
3010             New function for that grants cookie access under a whole page.
3011         * UIProcess/WebResourceLoadStatisticsStore.h:
3012             Member renaming since the frameID now is optional.
3013         * UIProcess/WebResourceLoadStatisticsStore.messages.in:
3014             New message received straight from WebCore::ResourceLoadObserver.
3015         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3016         (WebKit::WebsiteDataStore::grantStorageAccessHandler):
3017             Renamed and made frameID optional.
3018         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
3019             Consequence of renaming and making frameID optional.
3020         (WebKit::WebsiteDataStore::grantStorageAccessForFrameHandler): Deleted.
3021             Renamed and made frameID optional.
3022         * UIProcess/WebsiteData/WebsiteDataStore.h:
3023         * WebProcess/WebProcess.cpp:
3024         (WebProcess::WebProcess):
3025             Now calls setGrantStorageAccessUnderOpenerCallback() on the shared
3026             WebCore::ResourceLoadObserver.
3027
3028 2018-03-12  Tim Horton  <timothy_horton@apple.com>
3029
3030         Stop using SDK conditionals to control feature definitions
3031         https://bugs.webkit.org/show_bug.cgi?id=183430
3032         <rdar://problem/38251619>
3033
3034         Reviewed by Dan Bernstein.
3035
3036         * Configurations/FeatureDefines.xcconfig:
3037         * Configurations/WebKitTargetConditionals.xcconfig: Renamed.
3038
3039 2018-03-12  Yoav Weiss  <yoav@yoav.ws>
3040
3041         Runtime flag for link prefetch and remove link subresource.
3042         https://bugs.webkit.org/show_bug.cgi?id=183540
3043
3044         Reviewed by Chris Dumez.
3045
3046         Remove the LINK_PREFETCH build time flag.
3047
3048         * Configurations/FeatureDefines.xcconfig:
3049         * WebProcess/Network/WebLoaderStrategy.cpp:
3050         (WebKit::maximumBufferingTime):
3051
3052 2018-03-12  Chris Dumez  <cdumez@apple.com>
3053
3054         Load may get committed before receiving policy for the resource response
3055         https://bugs.webkit.org/show_bug.cgi?id=183579
3056         <rdar://problem/38268780>
3057
3058         Reviewed by Youenn Fablet.
3059
3060         r228852 updated WebResourceLoader::didReceiveResponse to only send the
3061         ContinueDidReceiveResponse IPC back to the Networkprocess *after* the
3062         policy decision for the resource response has been made. This is necessary
3063         now that policy decisions can be made asynchronously.
3064
3065         However, one of the 2 code paths in NetworkProcess side (code path when
3066         the resource is already in the HTTP disk cache) failed to wait for the
3067         ContinueDidReceiveResponse IPC before sending over the data to the WebProcess.
3068         As a result, the WebProcess could commit the load before even receiving the
3069         policy response from the client.        
3070
3071         * NetworkProcess/NetworkResourceLoader.cpp:
3072         (WebKit::NetworkResourceLoader::continueDidReceiveResponse):
3073         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
3074         (WebKit::NetworkResourceLoader::continueProcessingCachedEntryAfterDidReceiveResponse):
3075         * NetworkProcess/NetworkResourceLoader.h:
3076         Make sure NetworkResourceLoader::didRetrieveCacheEntry() does not start sending the data
3077         until the network process gets the ContinueDidReceiveResponse IPC back from the WebProcess.
3078
3079         * WebProcess/Network/WebResourceLoader.cpp:
3080         (WebKit::WebResourceLoader::didReceiveResponse):
3081         (WebKit::WebResourceLoader::didReceiveData):
3082         * WebProcess/Network/WebResourceLoader.h:
3083         Add assertion to make sure didReceiveData() never gets called before didReceiveResponse's
3084         completion handler has been called. If this hits, then the load may get committed even
3085         though the client did not reply to the policy for the resource response yet.
3086
3087 2018-03-12  Ali Juma  <ajuma@chromium.org>
3088
3089         http/tests/workers/service/service-worker-download.https.html times out with async policy delegates
3090         https://bugs.webkit.org/show_bug.cgi?id=183479
3091
3092         Reviewed by Youenn Fablet.
3093
3094         Ensure that ServiceWorkerFetchClient::m_isCheckingResponse is set before code that depends on it
3095         executes. This bit was set by code that's posted to the runloop using 'callOnMainThread' in
3096         ServiceWorkerFetchClient::didReceiveResponse. But when didReceiveResponse is executing, tasks for
3097         handling didReceiveData, didFail, or didFinish may already have been posted to the runloop, and in
3098         that case would execute before m_isCheckingResponse gets set, and then incorrectly fail to 
3099         early-out. Fix this by directly setting m_isCheckingResponse in didReceiveResponse.
3100
3101         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
3102         (WebKit::ServiceWorkerClientFetch::start):
3103         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
3104
3105 2018-03-12  Wenson Hsieh  <wenson_hsieh@apple.com>
3106
3107         REGRESSION(r211643): Dismissing WKActionSheet should not also dismiss its presenting view controller
3108         https://bugs.webkit.org/show_bug.cgi?id=183549
3109         <rdar://problem/34960698>
3110
3111         Reviewed by Andy Estes.
3112
3113         Fixes the bug by dismissing the presented view controller (i.e. the action sheet or the view controller being
3114         presented during rotation) rather than the presenting view controller.
3115
3116         Test: ActionSheetTests.DismissingActionSheetShouldNotDismissPresentingViewController
3117
3118         * UIProcess/ios/WKActionSheet.mm:
3119         (-[WKActionSheet doneWithSheet:]):
3120
3121 2018-03-12  Javier Fernandez  <jfernandez@igalia.com>
3122
3123         Remove GridLayout runtime flag
3124         https://bugs.webkit.org/show_bug.cgi?id=183484
3125
3126         Reviewed by Myles C. Maxfield.
3127
3128         The Grid Layout feature has been enabled by default for almost a
3129         year, so I think it's time to remove the runtime flag and the
3130         codepath run when the feature is disabled.
3131
3132         * Shared/WebPreferences.yaml:
3133         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3134         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
3135
3136 2018-03-11  Wenson Hsieh  <wenson_hsieh@apple.com>
3137
3138         Fix the internal iOS build after r229512
3139         https://bugs.webkit.org/show_bug.cgi?id=183550
3140
3141         Reviewed by Zalan Bujtas.
3142
3143         Fixes a typo in a header import, as well as a nullability error. `SecTrustEvaluate()` takes in a nonnull outparam,
3144         which was removed in r229512; this adds the outparam back, but does not consult its value when setting the
3145         `infoDictionary`.
3146
3147         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
3148         (-[WKFullScreenWindowController _EVOrganizationName]):
3149
3150 2018-03-10  Jer Noble  <jer.noble@apple.com>
3151
3152         Improvements to fullscreen; new UI and security features
3153         https://bugs.webkit.org/show_bug.cgi?id=183503
3154
3155         Reviewed by Dean Jackson.
3156
3157         Now that the iOS Fullscreen code has more than one major class, move it into an ios/
3158         directory.
3159
3160         Clean up the WKFullScreenWindowControllerIOS class to more clearly separate external
3161         facing API from purely internal functions.
3162
3163         Move the WKFullScreenViewController out into its own file. Add support for fullscreen
3164         top inset and fullscreen autohide duration CSS constants.
3165
3166         Add a heuristic to distinguish between media control related touches and ones that look
3167         more keyboard interactions.
3168
3169         Add a new UIStackView based control to hold the fullscreen controls.
3170
3171         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm: Removed.
3172         * UIProcess/ios/fullscreen/FullscreenTouchSecheuristic.cpp: Added.
3173         (WebKit::FullscreenTouchSecheuristic::scoreOfNextTouch):
3174         (WebKit::FullscreenTouchSecheuristic::reset):
3175         (WebKit::FullscreenTouchSecheuristic::distanceScore):
3176         (WebKit::FullscreenTouchSecheuristic::attenuationFactor):
3177         * UIProcess/ios/fullscreen/FullscreenTouchSecheuristic.h: 
3178         (WebKit::FullscreenTouchSecheuristic::setRampUpSpeed):
3179         (WebKit::FullscreenTouchSecheuristic::setRampDownSpeed):
3180         (WebKit::FullscreenTouchSecheuristic::setXWeight):
3181         (WebKit::FullscreenTouchSecheuristic::setYWeight):
3182         (WebKit::FullscreenTouchSecheuristic::setSize):
3183         (WebKit::FullscreenTouchSecheuristic::setGamma):
3184         (WebKit::FullscreenTouchSecheuristic::setGammaCutoff):
3185         * UIProcess/ios/fullscreen/WKFullScreenViewController.h:
3186         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm: Added.
3187         (WKFullScreenViewControllerPlaybackSessionModelClient::setParent):
3188         (WKFullScreenViewControllerPlaybackSessionModelClient::setInterface):
3189         (-[_WKExtrinsicButton setExtrinsicContentSize:]):
3190         (-[_WKExtrinsicButton intrinsicContentSize]):
3191         (-[WKFullScreenViewController initWithWebView:]):
3192         (-[WKFullScreenViewController dealloc]):
3193         (-[WKFullScreenViewController showUI]):
3194         (-[WKFullScreenViewController hideUI]):
3195         (-[WKFullScreenViewController videoControlsManagerDidChange]):
3196         (-[WKFullScreenViewController setPrefersStatusBarHidden:]):
3197         (-[WKFullScreenViewController setPlaying:]):
3198         (-[WKFullScreenViewController setPictureInPictureActive:]):
3199         (-[WKFullScreenViewController loadView]):
3200         (-[WKFullScreenViewController viewWillAppear:]):
3201         (-[WKFullScreenViewController viewDidLayoutSubviews]):
3202         (-[WKFullScreenViewController viewWillTransitionToSize:withTransitionCoordinator:]):
3203         (-[WKFullScreenViewController preferredStatusBarStyle]):
3204         (-[WKFullScreenViewController prefersStatusBarHidden]):
3205         (-[WKFullScreenViewController gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
3206         (-[WKFullScreenViewController gestureRecognizer:shouldReceiveTouch:]):
3207         (-[WKFullScreenViewController _manager]):
3208         (-[WKFullScreenViewController _effectiveFullscreenInsetTop]):
3209         (-[WKFullScreenViewController _cancelAction:]):
3210         (-[WKFullScreenViewController _togglePiPAction:]):
3211         (-[WKFullScreenViewController _touchDetected:]):
3212         (-[WKFullScreenViewController _statusBarFrameDidChange:]):
3213         (-[WKFullScreenViewController _updateWebViewFullscreenInsets]):
3214         (-[WKFullScreenViewController _showPhishingAlert]):
3215         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.h: Copied from Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.h.
3216         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm: Added.
3217         (WebKit::replaceViewWithView):
3218         (WebKit::WKWebViewState::applyTo):
3219         (WebKit::WKWebViewState::store):
3220         (-[WKFullscreenAnimationController transitionDuration:]):
3221         (-[WKFullscreenAnimationController configureInitialAndFinalStatesForTransition:]):
3222         (-[WKFullscreenAnimationController animateTransition:]):
3223         (-[WKFullscreenAnimationController animationEnded:]):
3224         (-[WKFullscreenAnimationController startInteractiveTransition:]):
3225         (-[WKFullscreenAnimationController updateWithPercent:]):
3226         (-[WKFullscreenAnimationController updateWithPercent:translation:anchor:]):
3227         (-[WKFullscreenAnimationController end:]):
3228         (-[WKFullScreenInteractiveTransition initWithAnimator:anchor:]):
3229         (-[WKFullScreenInteractiveTransition wantsInteractiveStart]):
3230         (-[WKFullScreenInteractiveTransition startInteractiveTransition:]):
3231         (-[WKFullScreenInteractiveTransition updateInteractiveTransition:withTranslation:]):
3232         (-[WKFullScreenInteractiveTransition cancelInteractiveTransition]):
3233         (-[WKFullScreenInteractiveTransition finishInteractiveTransition]):
3234         (-[WKFullScreenWindowController initWithWebView:]):
3235         (-[WKFullScreenWindowController dealloc]):
3236         (-[WKFullScreenWindowController isFullScreen]):
3237         (-[WKFullScreenWindowController webViewPlaceholder]):
3238         (-[WKFullScreenWindowController enterFullScreen]):
3239         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
3240         (-[WKFullScreenWindowController requestExitFullScreen]):
3241         (-[WKFullScreenWindowController exitFullScreen]):
3242         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
3243         (-[WKFullScreenWindowController _completedExitFullScreen]):
3244         (-[WKFullScreenWindowController close]):
3245         (-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]):
3246         (-[WKFullScreenWindowController videoControlsManagerDidChange]):
3247         (-[WKFullScreenWindowController gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
3248         (-[WKFullScreenWindowController animationControllerForPresentedController:presentingController:sourceController:]):
3249         (-[WKFullScreenWindowController animationControllerForDismissedController:]):
3250         (-[WKFullScreenWindowController interactionControllerForDismissal:]):
3251         (-[WKFullScreenWindowController _exitFullscreenImmediately]):
3252         (-[WKFullScreenWindowController _invalidateEVOrganizationName]):
3253         (-[WKFullScreenWindowController _isSecure]):
3254         (-[WKFullScreenWindowController _serverTrust]):
3255         (-[WKFullScreenWindowController _EVOrganizationName]):
3256         (-[WKFullScreenWindowController _updateLocationInfo]):
3257         (-[WKFullScreenWindowController _manager]):
3258         (-[WKFullScreenWindowController _startToDismissFullscreenChanged:]):
3259         (-[WKFullScreenWindowController _interactiveDismissChanged:]):
3260         * UIProcess/ios/fullscreen/WKFullscreenStackView.h: Renamed from Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.h.
3261         * UIProcess/ios/fullscreen/WKFullscreenStackView.mm: Added.
3262         (+[WKFullscreenStackView baseEffects]):
3263         (+[WKFullscreenStackView configureView:forTintEffectWithColor:filterType:]):
3264         (+[WKFullscreenStackView configureView:withBackgroundFillOfColor:opacity:filter:]):
3265         (+[WKFullscreenStackView secondaryMaterialOverlayView]):
3266         (+[WKFullscreenStackView applyPrimaryGlyphTintToView:]):
3267         (+[WKFullscreenStackView applySecondaryGlyphTintToView:]):
3268         (-[WKFullscreenStackView initWithArrangedSubviews:axis:]):
3269         (-[WKFullscreenStackView setTargetViewForSecondaryMaterialOverlay:]):
3270         (-[WKFullscreenStackView contentView]):
3271         (-[WKFullscreenStackView _setArrangedSubviews:axis:]):
3272         (-[WKFullscreenStackView setBounds:]):
3273         (-[WKFullscreenStackView updateConstraints]):
3274         * WebKit.xcodeproj/project.pbxproj:
3275
3276 2018-03-10  Megan Gardner  <megan_gardner@apple.com>
3277
3278         Media query for default appearance
3279         https://bugs.webkit.org/show_bug.cgi?id=183539
3280         <rdar://problem/38326388>
3281
3282         Reviewed by Tim Horton.
3283
3284         Write a media query to evaluate appearance.
3285
3286         * Shared/WebPageCreationParameters.cpp:
3287         (WebKit::WebPageCreationParameters::encode const):
3288         (WebKit::WebPageCreationParameters::decode):
3289         * Shared/WebPageCreationParameters.h:
3290         * UIProcess/API/Cocoa/WKWebView.mm:
3291         (-[WKWebView _initializeWithConfiguration:]):
3292         (-[WKWebView _setUseSystemAppearance:]):
3293         * UIProcess/WebPageProxy.cpp:
3294         (WebKit::WebPageProxy::creationParameters):
3295         (WebKit::WebPageProxy::setDefaultAppearance):
3296         * UIProcess/WebPageProxy.h:
3297         (WebKit::WebPageProxy::defaultAppearance const):
3298         * WebProcess/WebPage/WebPage.cpp:
3299         (WebKit::m_credentialsMessenger):
3300         (WebKit::WebPage::setDefaultAppearance):
3301         * WebProcess/WebPage/WebPage.h:
3302         * WebProcess/WebPage/WebPage.messages.in:
3303
3304 2018-03-09  Jer Noble  <jer.noble@apple.com>
3305
3306         Unconditionalize more methods in VideoFullscreenInterface (and related classes)
3307         https://bugs.webkit.org/show_bug.cgi?id=183501
3308         <rdar://problem/38312038>
3309
3310         Unreviewed build fix; add correct pragmas to code referencing m_playbackSessionManager.
3311
3312         * UIProcess/WebPageProxy.cpp:
3313         (WebKit::WebPageProxy::hasActiveVideoForControlsManager const):
3314         (WebKit::WebPageProxy::requestControlledElementID const):
3315         (WebKit::WebPageProxy::isPlayingVideoInEnhancedFullscreen const):
3316
3317 2018-03-09  Brian Burg  <bburg@apple.com>
3318
3319         Web Inspector: there should only be one way for async backend commands to send failure
3320         https://bugs.webkit.org/show_bug.cgi?id=183524
3321
3322         Reviewed by Timothy Hatcher.
3323
3324         Remove useless ErrorString argument from async commands.
3325
3326         For Automation protocol, introduce sync and async macros for filling
3327         in and sending a failure response. Now that async commands don't have
3328         an ErrorString and sync commands don't have a callback, trying to send
3329         an error with the wrong macro is a compile-time error.
3330
3331         * UIProcess/Automation/WebAutomationSession.cpp:
3332         (WebKit::WebAutomationSession::getBrowsingContexts):
3333         (WebKit::WebAutomationSession::getBrowsingContext):
3334         (WebKit::WebAutomationSession::createBrowsingContext):
3335         (WebKit::WebAutomationSession::closeBrowsingContext):
3336         (WebKit::WebAutomationSession::switchToBrowsingContext):
3337         (WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext):
3338         (WebKit::WebAutomationSession::waitForNavigationToComplete):
3339         (WebKit::WebAutomationSession::navigateBrowsingContext):
3340         (WebKit::WebAutomationSession::goBackInBrowsingContext):
3341         (WebKit::WebAutomationSession::goForwardInBrowsingContext):
3342         (WebKit::WebAutomationSession::reloadBrowsingContext):
3343         (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
3344         (WebKit::WebAutomationSession::resolveChildFrameHandle):
3345         (WebKit::WebAutomationSession::resolveParentFrameHandle):
3346         (WebKit::WebAutomationSession::computeElementLayout):
3347         (WebKit::WebAutomationSession::selectOptionElement):
3348         (WebKit::WebAutomationSession::isShowingJavaScriptDialog):
3349         (WebKit::WebAutomationSession::dismissCurrentJavaScriptDialog):
3350         (WebKit::WebAutomationSession::acceptCurrentJavaScriptDialog):
3351         (WebKit::WebAutomationSession::messageOfCurrentJavaScriptDialog):
3352         (WebKit::WebAutomationSession::setUserInputForCurrentJavaScriptPrompt):
3353         (WebKit::WebAutomationSession::setFilesToSelectForFileUpload):
3354         (WebKit::WebAutomationSession::getAllCookies):
3355         (WebKit::WebAutomationSession::deleteSingleCookie):
3356         (WebKit::WebAutomationSession::addSingleCookie):
3357         (WebKit::WebAutomationSession::deleteAllCookies):
3358         (WebKit::WebAutomationSession::setSessionPermissions):
3359         (WebKit::WebAutomationSession::performMouseInteraction):
3360         (WebKit::WebAutomationSession::performKeyboardInteractions):
3361         (WebKit::WebAutomationSession::takeScreenshot):
3362         (WebKit::WebAutomationSession::didTakeScreenshot):
3363         * UIProcess/Automation/WebAutomationSession.h:
3364         * UIProcess/Automation/WebAutomationSessionMacros.h:
3365         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
3366         (WebKit::WebAutomationSession::inspectBrowsingContext):
3367
3368 2018-03-09  Jer Noble  <jer.noble@apple.com>
3369
3370         Don't pass NULL to the result parameter of SecTrustEvaluate()
3371         https://bugs.webkit.org/show_bug.cgi?id=183495
3372         <rdar://problem/38185688>
3373
3374         Reviewed by Andy Estes.
3375
3376         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm:
3377         (-[WKFullScreenWindowController _EVOrganizationName]):
3378
3379 2018-03-09  Dean Jackson  <dino@apple.com>
3380
3381         Allow NavigationState to intercept requests and send them to SystemPreviewController
3382         https://bugs.webkit.org/show_bug.cgi?id=183526
3383         <rdar://problem/37801140>
3384
3385         Reviewed by Tim Horton.
3386
3387         Implement a bit more of SystemPreviewController, such that it can be used
3388         from NavigationState to identify and handle content that can be previewed.
3389
3390         * UIProcess/Cocoa/NavigationState.mm:
3391         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
3392             If we'd in a download response policy, then check if SystemPreviewController
3393             can show the content. We ignore the download, but pass the original URL onto
3394             the preview. Ultimately, we'd want to avoid the navigation
3395             but use the download destination URL for preview.
3396
3397         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
3398         (-[_WKPreviewControllerDataSource initWithURL:]):
3399             Move the URL to property, to help use a single datasource object for all previews.
3400         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
3401         (-[_WKPreviewControllerDelegate initWithSystemPreviewController:]):
3402             Add a delegate object, so we can detect when the preview is dismissed and return
3403             to the previous page.
3404         (-[_WKPreviewControllerDelegate previewControllerWillDismiss:]):
3405         (WebKit::SystemPreviewController::showPreview):
3406             Use single instances of the QLPreviewController, its datasource and delegate.
3407
3408         * UIProcess/SystemPreviewController.cpp: