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