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