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