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