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