64343bb6507b3b1796511c2b6f5019771212bcd8
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-02-10  Darin Adler  <darin@apple.com>
2
3         Replace more uses of String::format with StringConcatenate (mostly non-Apple platform-specific cases)
4         https://bugs.webkit.org/show_bug.cgi?id=194487
5
6         Reviewed by Daniel Bates.
7
8         * NetworkProcess/NetworkProcess.cpp:
9         (WebKit::NetworkProcess::switchToNewTestingSession): Use makeString instead of String::format.
10         * NetworkProcess/soup/NetworkProcessSoup.cpp:
11         (WebKit::buildAcceptLanguages): Ditto.
12         * UIProcess/API/glib/IconDatabase.cpp:
13         (WebKit::IconDatabase::performURLImport): Ditto.
14         * UIProcess/gtk/InputMethodFilter.cpp:
15         (WebKit::InputMethodFilter::logConfirmCompositionForTesting): Ditto.
16         (WebKit::InputMethodFilter::logSetPreeditForTesting): Ditto.
17
18 2019-02-15  Truitt Savell  <tsavell@apple.com>
19
20         Unreviewed, rolling out r241564.
21
22         Caused 50+ Timeouts on Mac WK2, mostly in the http/ directory
23
24         Reverted changeset:
25
26         "[Mac] WebInspectorUI.framework does not need to be soft-
27         linked anymore"
28         https://bugs.webkit.org/show_bug.cgi?id=194411
29         https://trac.webkit.org/changeset/241564
30
31 2019-02-15  Carlos Garcia Campos  <cgarcia@igalia.com>
32
33         Unreviewed. Fix GTK+ build after r241556
34
35         I guess this is due to unified builds after a new file being added in r241556.
36
37         * UIProcess/API/C/WKAuthenticationDecisionListener.cpp:
38         * UIProcess/API/C/WKPage.cpp:
39
40 2019-02-14  Brent Fulgham  <bfulgham@apple.com>
41
42         REGRESSION (r240446): Storage Access API does not handle domains consistently
43         https://bugs.webkit.org/show_bug.cgi?id=194664
44
45         Reviewed by Alex Christensen.
46         
47         During my refactoring of the ResourceLoadStatistics code, I introduced two bugs:
48         (1) I neglected to be consistent in my use of 'primaryDomain', causing some Storage
49         Access API code paths to store approves under one domain (e.g., 'www.example.com'),
50         while checking status under the eTLD+1 (e.g., 'example.com'). The exact string matching
51         requirement caused these to get missed.
52
53         (2) I used a move operator before a final set of copies of domain names, leading to
54         some empty strings being passed to Storage Access API calls.
55
56         Both issues are corrected in this patch.
57
58         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
59         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode): Always make the
60         domain comply with our 'primaryDomain' logic.
61         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess): Ditto.
62         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted): Ditto.
63         (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation): Ditto.
64         (WebKit::WebResourceLoadStatisticsStore::logWebSocketLoading): Ditto.
65         (WebKit::WebResourceLoadStatisticsStore::logSubresourceLoading): Ditto.
66         (WebKit::WebResourceLoadStatisticsStore::logSubresourceRedirect): Ditto.
67         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction): Ditto.
68         (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction): Ditto.
69         (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction): Ditto.
70         (WebKit::WebResourceLoadStatisticsStore::setLastSeen): Ditto.
71         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource): Ditto.
72         (WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource): Ditto.
73         (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource): Ditto.
74         (WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource): Ditto.
75         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubresourceUnder): Ditto.
76         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder): Ditto.
77         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo): Ditto.
78         (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource): Ditto.
79         (WebKit::WebResourceLoadStatisticsStore::setGrandfathered): Ditto.
80         (WebKit::WebResourceLoadStatisticsStore::isGrandfathered): Ditto.
81         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin): Ditto.
82         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin): Ditto.
83         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo): Ditto.
84         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom): Ditto.
85         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo): Ditto.
86         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom): Ditto.
87         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
88         (WebKit::WebsiteDataStore::hasStorageAccess): Always make the
89         domain comply with our 'primaryDomain' logic.
90         (WebKit::WebsiteDataStore::requestStorageAccess): Ditto. Also make copy of domain
91         names before moving them to the completion handler.
92         (WebKit::WebsiteDataStore::grantStorageAccess): Ditto.
93         * WebProcess/WebPage/WebPage.cpp:
94         (WebKit::WebPage::hasStorageAccess):  Always make the domain comply with our
95         'primaryDomain' logic.
96         (WebKit::WebPage::requestStorageAccess): Ditto.
97
98 2019-02-14  Tim Horton  <timothy_horton@apple.com>
99
100         Fix the build.
101
102         * UIProcess/ios/WKDrawingView.mm:
103         (-[WKDrawingView renderedDrawing]):
104
105 2019-02-14  Youenn Fablet  <youenn@apple.com>
106
107         ASSERTION FAILED: m_caches.isEmpty() || !m_pendingInitializationCallbacks.isEmpty() in WebKit::CacheStorage::Caches::clearMemoryRepresentation()
108         https://bugs.webkit.org/show_bug.cgi?id=188393
109         <rdar://problem/43025665>
110
111         Reviewed by Alex Christensen.
112
113         In case Caches::dispose is called, clearMemoryRepresentation might be called if there is no active cache.
114         We also ensure to not clear the memory representation if there is any remaining removed cache.
115         Update the clearMemoryRepresentation assertion to take that into account.
116
117         In case a Caches is cleared twice, the clearMemoryRepresentation assertion will assert while it should not.
118         In that case m_storage is null the second time. Update the assertion accordingly.
119
120         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
121         (WebKit::CacheStorage::Caches::hasActiveCache const):
122         (WebKit::CacheStorage::Caches::dispose):
123         (WebKit::CacheStorage::Caches::clearMemoryRepresentation):
124         * NetworkProcess/cache/CacheStorageEngineCaches.h:
125
126 2019-02-14  Brian Burg  <bburg@apple.com>
127
128         [Mac] WebInspectorUI.framework does not need to be soft-linked anymore
129         https://bugs.webkit.org/show_bug.cgi?id=194411
130         <rdar://problem/47787614>
131
132         Reviewed by Joseph Pecoraro.
133
134         * Configurations/WebKit.xcconfig:
135         Conditionalize weak linking to WebInspectorUI.framework for Mac only.
136
137         * UIProcess/mac/WebInspectorProxyMac.mm:
138         (WebKit::WebInspectorProxy::inspectorPageURL):
139         (WebKit::WebInspectorProxy::inspectorTestPageURL):
140         (WebKit::WebInspectorProxy::inspectorBaseURL):
141         * WebProcess/WebPage/mac/WebInspectorUIMac.mm:
142         (WebKit::webInspectorUILocalizedStringsURL):
143         Rewrite uses of the bundle to exit early if bundle couldn't be loaded.
144
145 2019-02-14  Michael Catanzaro  <mcatanzaro@igalia.com>
146
147         [GTK] WebKitGTK+ -> WebKitGTK
148         https://bugs.webkit.org/show_bug.cgi?id=194658
149
150         Reviewed by Alex Christensen.
151
152         This renames WebKitGTK+ to WebKitGTK in a few user-visible places: the API documentation,
153         the pkg-config, and an error message.
154
155         In a couple places where it's exposed in WPE documentation, WPE is now mentioned, or the
156         reference to "WebKitGTK+" is changed to just "WebKit."
157
158         * UIProcess/API/glib/WebKitSettings.cpp:
159         (webkit_settings_class_init):
160         * UIProcess/API/glib/WebKitWebView.cpp:
161         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
162         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivateGtk.h:
163         * gtk/webkit2gtk-web-extension.pc.in:
164         * gtk/webkit2gtk.pc.in:
165
166 2019-02-14  Ross Kirsling  <ross.kirsling@sony.com>
167
168         [WTF] Add environment variable helpers
169         https://bugs.webkit.org/show_bug.cgi?id=192405
170
171         Reviewed by Michael Catanzaro.
172
173         * NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp:
174         (main):
175         * Platform/unix/EnvironmentUtilities.cpp:
176         (WebKit::EnvironmentUtilities::stripValuesEndingWithString):
177         * Platform/unix/LoggingUnix.cpp:
178         (WebKit::logLevelString):
179         * Platform/win/LoggingWin.cpp:
180         (WebKit::logLevelString):
181         * PluginProcess/mac/PluginProcessMac.mm:
182         (WebKit::shouldCallRealDebugger):
183         * Shared/Plugins/unix/PluginSearchPath.cpp:
184         (WebKit::pluginsDirectories):
185         * Shared/glib/ProcessExecutablePathGLib.cpp:
186         (WebKit::findWebKitProcess):
187         * UIProcess/API/glib/WebKitSettings.cpp:
188         (webKitSettingsConstructed):
189         (webKitSettingsSetProperty):
190         * UIProcess/API/glib/WebKitWebContext.cpp:
191         (injectedBundleDirectory):
192         (webkitWebContextConstructed):
193         * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
194         (webkitWebViewMaximizeWindow):
195         (webkitWebViewRestoreWindow):
196         * UIProcess/API/wpe/WPEView.cpp:
197         (WKWPE::m_backend):
198         * UIProcess/AuxiliaryProcessProxy.cpp:
199         (WebKit::AuxiliaryProcessProxy::getLaunchOptions):
200         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
201         (WebKit::XDGDBusProxyLauncher::launch):
202         (WebKit::bindDBusSession):
203         (WebKit::bindX11):
204         (WebKit::bindWayland):
205         (WebKit::bindPulse):
206         (WebKit::bindPathVar):
207         (WebKit::bindGStreamerData):
208         (WebKit::bubblewrapSpawn):
209         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
210         (WebKit::ProcessLauncher::launchProcess):
211         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
212         (WebKit::systemDirectoryPath):
213         (WebKit::ProcessLauncher::launchProcess):
214         * UIProcess/glib/WebProcessPoolGLib.cpp:
215         (WebKit::memoryPressureMonitorDisabled):
216         (WebKit::WebProcessPool::platformInitialize):
217         (WebKit::WebProcessPool::platformInitializeWebProcess):
218         * UIProcess/gtk/HardwareAccelerationManager.cpp:
219         (WebKit::HardwareAccelerationManager::HardwareAccelerationManager):
220         * WebProcess/EntryPoint/unix/WebProcessMain.cpp:
221         (main):
222         * WebProcess/gtk/WebProcessMainGtk.cpp:
223         * WebProcess/wpe/WebProcessMainWPE.cpp:
224         Utilize WTF::Environment where possible.
225
226 2019-02-14  Jiewen Tan  <jiewen_tan@apple.com>
227
228         Handle _WKNavigationActionPolicyAllowWithoutTryingAppLink for LoadOptimizer
229         https://bugs.webkit.org/show_bug.cgi?id=194640
230         <rdar://problem/48064140>
231
232         Reviewed by Brent Fulgham.
233
234         * UIProcess/Cocoa/NavigationState.mm:
235         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
236
237 2019-02-14  Chris Dumez  <cdumez@apple.com>
238
239         [PSON] Introduce a WebContent Process cache
240         https://bugs.webkit.org/show_bug.cgi?id=194594
241         <rdar://problem/46793397>
242
243         Reviewed by Geoff Garen.
244
245         Introduce a WebContent Process cache to reduce the number of process launches when
246         process swap on navigation is enabled, and to reduce the power cost of the feature.
247
248         If a WebProcess loaded pages from a single registrable domain then it is eligible
249         for the cache. When process-swapping on navigation to a new registrable domain, we
250         now attempt to retrieve a process from the cache for the domain in question instead
251         of always launching a new one.
252
253         The WebProcess cache currently has the following attributes:
254         - It may contains 4 processes per GB of RAM the machine has, up to 30 processes.
255         - WebProcesses automatically get evicted from the cache after 30 minutes.
256         - If the application is no longer the active app, then the cache will get cleared
257           after 5 minutes.
258         - WebProcesses that are in the cache are reported as "(Cached)" in Activity Monitor.
259
260         The WebProcess cache is currently disabled by default and can by enabled by the
261         client via SPI.
262
263         * Shared/WebBackForwardListItem.cpp:
264         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
265         * Shared/WebBackForwardListItem.h:
266         (WebKit::WebBackForwardListItem::lastProcessIdentifier const):
267         (WebKit::WebBackForwardListItem::setLastProcessIdentifier):
268         Add new lastProcessIdentifier data member that reflects which process this item
269         was last loaded in. It is normally identical to the identifier of the process
270         that created the item but it gets overriden in case of cross-site client-side
271         redirect, since a new process takes over the item in this case.
272
273         * Sources.txt:
274         Add new source file.
275
276         * UIProcess/API/APIProcessPoolConfiguration.cpp:
277         (API::ProcessPoolConfiguration::copy):
278         * UIProcess/API/APIProcessPoolConfiguration.h:
279         * UIProcess/API/C/WKContextConfigurationRef.cpp:
280         (WKContextConfigurationUsesWebProcessCache):
281         (WKContextConfigurationSetUsesWebProcessCache):
282         * UIProcess/API/C/WKContextConfigurationRef.h:
283         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
284         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
285         (-[_WKProcessPoolConfiguration setUsesWebProcessCache:]):
286         (-[_WKProcessPoolConfiguration usesWebProcessCache]):
287         Add new SPI to enable the WebProcess cache.
288
289         * UIProcess/API/Cocoa/WKProcessPool.mm:
290         (-[WKProcessPool _webProcessCountIgnoringPrewarmedAndCached]):
291         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
292         Add new SPI for testing which returns the number of WebProcesses ignoring
293         both prewarmed and cached ones.
294
295         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
296         (WebKit::WebProcessPool::registerNotificationObservers):
297         (WebKit::WebProcessPool::unregisterNotificationObservers):
298         Add application active state observers as the WebProcess cache gets cleared
299         when the application resigns active state for more than 5 minutes.
300
301         * UIProcess/ProvisionalPageProxy.cpp:
302         (WebKit::ProvisionalPageProxy::loadRequest):
303         When doing a load in a new process with the BackForwardList locked (i.e. client-side
304         redirect), make sure we update the last process identifier for the BackForwardListItem.
305         This is important because the logic in WebProcessPool::processForNavigation() relies on
306         this identifier to select which process to do the history navigation into, and we want
307         to do the load in the post-redirect process, not the pre-redirect one.
308
309         * UIProcess/WebPageProxy.cpp:
310         (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
311         Tell the WebProcess whenever a main frame provisional load is started, providing the URL.
312
313         * UIProcess/WebProcessCache.cpp: Added.
314         (WebKit::WebProcessCache::WebProcessCache):
315         (WebKit::WebProcessCache::addProcess):
316         (WebKit::WebProcessCache::takeProcess):
317         (WebKit::WebProcessCache::updateMaximumSize):
318         (WebKit::WebProcessCache::clear):
319         (WebKit::WebProcessCache::setApplicationIsActive):
320         (WebKit::WebProcessCache::evictProcess):
321         (WebKit::WebProcessCache::CachedProcess::CachedProcess):
322         (WebKit::WebProcessCache::CachedProcess::~CachedProcess):
323         (WebKit::WebProcessCache::CachedProcess::takeProcess):
324         (WebKit::WebProcessCache::CachedProcess::evictionTimerFired):
325         * UIProcess/WebProcessCache.h: Added.
326         (WebKit::WebProcessCache::maximumSize):
327         (WebKit::WebProcessCache::size const):
328         (WebKit::WebProcessCache::CachedProcess::process):
329         Add process cache implementation.
330
331         * UIProcess/WebProcessPool.cpp:
332         (WebKit::m_webProcessCache):
333         WebProcessCache is stored on the WebProcessPool via m_webProcessCache data member.
334
335         (WebKit::WebProcessPool::~WebProcessPool):
336         Clear the WebProcess cache in the destructor.
337
338         (WebKit::WebProcessPool::setApplicationIsActive):
339         Notify the WebProcessCache whenever the application's active state changes.
340
341         (WebKit::WebProcessPool::createWebPage):
342         If the state of PSON changes via the experimental features menu, dynamically
343         update the WebProcessCache's size. This is needed because the cache is disabled
344         when PSON is disabled.
345
346         (WebKit::WebProcessPool::handleMemoryPressureWarning):
347         Clear the WebProcess cache on memory pressure.
348
349         (WebKit::WebProcessPool::processForNavigationInternal):
350         Query the WebProcessCache before attempting to create a new WebProcess for a cross-site
351         navigation.
352
353         (WebKit::WebProcessPool::findReusableSuspendedPageProcess):
354         This logic was split out of processForNavigationInternal() to reduce the size
355         of the method.
356
357         * UIProcess/WebProcessPool.h:
358         * UIProcess/WebProcessProxy.cpp:
359         (WebKit::WebProcessProxy::setIsInProcessCache):
360         Update the isInProcessCache flag on the WebProcessProxy and send an IPC to the WebContent
361         process so that it can update its name in Activity Monitor.
362         We also need to stop holding a strong reference to the WebProcessPool whenever the process
363         is in the cache, similarly to what we do for pre-warmed processes, given that such processes
364         should not keep the process pool alive.
365
366         (WebKit::WebProcessProxy::addExistingWebPage):
367         Assert that we never try to add a page to a cached process, it should be taken out of the
368         cache before use.
369
370         (WebKit::WebProcessProxy::hasProvisionalPageWithID const):
371         (WebKit::WebProcessProxy::isAllowedToUpdateBackForwardItem const):
372         (WebKit::WebProcessProxy::updateBackForwardItem):
373         In case of client-side redirects, the previous process would sometimes send an IPC causing
374         the UIProcess' backforward list item to get updated with the pre-redirect URL after we've
375         already redirected. This previously would be unlikely to occur because we do not suspend
376         client-redirect pages and their process would normally exit before getting a chance to send
377         the IPC. However, with the process cache, the bug became obvious as the process would stay
378         alive and send up the "bad" IPC. To address the issue, we now only let the IPC update the
379         item if the item's page is (still) associated with the process. In the future, we may want
380         to update the IPC so that it gets sent to the WebPageProxy instead of the WebProcessProxy.
381
382         (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
383         If a cached WebProcess crashes, remove it from the cache so that we do not attempt to use
384         it for a load later.
385
386         (WebKit::WebProcessProxy::canBeAddedToWebProcessCache const):
387         Only cache WebProcesses that have loaded a single registrable domain. Also prevent caching
388         for service worker and inspector processes.
389
390         (WebKit::WebProcessProxy::maybeShutDown):
391         If the process is cacheable, add it to the cache instead of shutting it down right away.
392
393         (WebKit::WebProcessProxy::canTerminateAuxiliaryProcess):
394         Make sure we do not attempt to terminate a processes that is in the cache.
395
396         (WebKit::WebProcessProxy::didStartProvisionalLoadForMainFrame):
397         Whenever a main frame provisional load starts, make sure we update the process's associated
398         registrable domain. nullopt indicates that there is no associated domain yet. Null string
399         indicates that the process is associated with several registrable domain and is therefore
400         not eligible for caching.
401
402         * UIProcess/WebProcessProxy.h:
403         (WebKit::WebProcessProxy::registrableDomain const):
404         (WebKit::WebProcessProxy::isInProcessCache const):
405         (WebKit::WebProcessProxy::provisionalPageCount const):
406         Add convenience getters.
407
408         * WebKit.xcodeproj/project.pbxproj:
409         Add new files to project.
410
411         * WebProcess/WebProcess.cpp:
412         (WebKit::WebProcess::setIsInProcessCache):
413         * WebProcess/WebProcess.h:
414         * WebProcess/WebProcess.messages.in:
415         * WebProcess/cocoa/WebProcessCocoa.mm:
416         (WebKit::WebProcess::updateProcessName):
417         Update the WebProcess' name in Activity Monitor whenever it goes into or out of the WebProcess
418         cache.
419
420 2019-02-14  Per Arne Vollan  <pvollan@apple.com>
421
422         [iOS] Open sandbox for certain calls.
423         https://bugs.webkit.org/show_bug.cgi?id=194626
424
425         Reviewed by Brent Fulgham.
426
427         Reporting shows that certain calls needs to be allowed in the sandbox.
428
429         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
430
431 2019-02-14  Chris Fleizach  <cfleizach@apple.com>
432
433         AX: ARIA Reflection was disabled in error
434         https://bugs.webkit.org/show_bug.cgi?id=194647
435         <rdar://problem/48068336>
436
437         Reviewed by Ryosuke Niwa.
438
439         * Shared/WebPreferences.yaml:
440
441 2019-02-14  Commit Queue  <commit-queue@webkit.org>
442
443         Unreviewed, rolling out r241486.
444         https://bugs.webkit.org/show_bug.cgi?id=194655
445
446         causing API failures in builds (Requested by ShawnRoberts on
447         #webkit).
448
449         Reverted changeset:
450
451         "[Cocoa] Media elements will restart network buffering just
452         before suspending"
453         https://bugs.webkit.org/show_bug.cgi?id=193691
454         https://trac.webkit.org/changeset/241486
455
456 2019-02-14  Youenn Fablet  <youenn@apple.com>
457
458         Do not add a caches to its engine if the salt cannot be initialized
459         https://bugs.webkit.org/show_bug.cgi?id=194604
460
461         Reviewed by Antti Koivisto.
462
463         This is a follow-up to https://bugs.webkit.org/show_bug.cgi?id=194588.
464         We should return early if initialize fails.
465
466         * NetworkProcess/cache/CacheStorageEngine.cpp:
467         (WebKit::CacheStorage::Engine::readCachesFromDisk):
468
469 2019-02-13  Carlos Garcia Campos  <cgarcia@igalia.com>
470
471         [GTK] Use a scrolled window for script alerts text
472         https://bugs.webkit.org/show_bug.cgi?id=184875
473
474         Reviewed by Michael Catanzaro.
475
476         To ensure long text doesn't make the dialog bigger.
477
478         * UIProcess/API/gtk/WebKitScriptDialogImpl.cpp:
479         (webkitScriptDialogImplConstructed): Use PANGO_ELLIPSIZE_END for the title and add a scrolled window for the body.
480         (webkitScriptDialogImplSetText): Helper function to set the dialog body, ensuring the scrolled window fills the
481         dialog available size.
482         (webkitScriptDialogImplNew): It now receives the maximum size and uses webkitScriptDialogImplSetText().
483         * UIProcess/API/gtk/WebKitScriptDialogImpl.h:
484         * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
485         (webkitWebViewScriptDialog): Pass the 80% of the web view size as the maximum size of script dialogs.
486
487 2019-02-13  Ryosuke Niwa  <rniwa@webkit.org>
488
489         Crash in WKBundleFrameGetParentFrame when called inside didRemoveFrameFromHierarchy
490         https://bugs.webkit.org/show_bug.cgi?id=194641
491
492         Reviewed by Geoffrey Garen.
493
494         Fixed the bug by adding a null check to WebFrame::parentFrame.
495
496         * WebProcess/WebPage/WebFrame.cpp:
497         (WebKit::WebFrame::parentFrame const):
498
499 2019-02-13  Timothy Hatcher  <timothy@apple.com>
500
501         Allow some deprecations in WKDrawingView.
502         https://bugs.webkit.org/show_bug.cgi?id=194636
503
504         Reviewed by Wenson Hsieh.
505
506         * UIProcess/ios/WKDrawingView.mm:
507         (-[WKDrawingView PNGRepresentation]):
508         (-[WKDrawingView loadDrawingFromPNGRepresentation:]):
509         (-[WKDrawingView _canvasViewWillBeginDrawing:]):
510         (-[WKDrawingView didChangeInk:]):
511
512 2019-02-13  Jer Noble  <jer.noble@apple.com>
513
514         [Cocoa] Media elements will restart network buffering just before suspending
515         https://bugs.webkit.org/show_bug.cgi?id=193691
516
517         Reviewed by Eric Carlson.
518
519         When the WebProcess receives a notification that the process is about to become
520         suspended, it tells the MemoryPressureHandler to release all critical memory. This
521         has the side effect of causing AVFoundation-backed media elements to dump their
522         in-memory caches and start downloading media data again. Instead, media elements
523         should all stop buffering media data during suspension. Add new testing SPI to
524         simulate suspension and resume messages.
525
526         * UIProcess/API/Cocoa/WKWebView.mm:
527         (-[WKWebView _processWillSuspendImminentlyForTesting]):
528         (-[WKWebView _processDidResumeForTesting]):
529         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
530         * UIProcess/WebProcessProxy.h:
531         * UIProcess/ios/WKInkPickerView.mm:
532         * WebProcess/WebPage/WebPage.cpp:
533         (WebKit::WebPage::suspendAllMediaBuffering):
534         (WebKit::WebPage::resumeAllMediaBuffering):
535         * WebProcess/WebPage/WebPage.h:
536         * WebProcess/WebProcess.cpp:
537         (WebKit::WebProcess::actualPrepareToSuspend):
538         (WebKit::WebProcess::cancelPrepareToSuspend):
539         (WebKit::WebProcess::processDidResume):
540         (WebKit::WebProcess::suspendAllMediaBuffering):
541         (WebKit::WebProcess::resumeAllMediaBuffering):
542         * WebProcess/WebProcess.h:
543
544 2019-02-13  Per Arne Vollan  <pvollan@apple.com>
545
546         [iOS] Fix sandbox violation during media playback
547         https://bugs.webkit.org/show_bug.cgi?id=194616
548         <rdar://problem/48049264>
549
550         Reviewed by Brent Fulgham.
551
552         Mach lookup to "com.apple.coremedia.figcontentkeysession.xpc" should be allowed.
553
554         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
555
556 2019-02-13  Tim Horton  <timothy_horton@apple.com>
557
558         Encrypted PDFs inside <embed> or <object> crash the Web Content process
559         https://bugs.webkit.org/show_bug.cgi?id=194605
560         <rdar://problem/19894818>
561
562         Reviewed by Andy Estes.
563
564         * WebProcess/Plugins/PDF/PDFPlugin.mm:
565         (WebKit::PDFPlugin::createPasswordEntryForm):
566         Don't try to create a password form field if we can't make form fields.
567
568         This means you will be left with a useless embedded PDF, but at least
569         the Web Content process won't crash.
570
571         We'll need to find an alternative implementation of PDF embedded form
572         fields that is compatible with <embed> and <object> if we want to support
573         this. Currently we piggy-back off the fact that we can just insert
574         <input>s into the PluginDocument's DOM, but we can't do that if there
575         is no PluginDocument, just a main document, like in the <embed> case.
576
577 2019-02-12  Jiewen Tan  <jiewen_tan@apple.com>
578
579         Further restricting webarchive loads
580         https://bugs.webkit.org/show_bug.cgi?id=194567
581         <rdar://problem/47610130>
582
583         Reviewed by Youenn Fablet.
584
585         * WebProcess/WebPage/WebPage.cpp:
586         (WebKit::WebPage::loadRequest):
587         Set a flag to indicate a load is started from clients.
588
589 2019-02-13  Michael Catanzaro  <mcatanzaro@igalia.com>
590
591         [WPE][GTK] Merge WebProcessPoolWPE.cpp and WebProcessPoolGtk.cpp
592         https://bugs.webkit.org/show_bug.cgi?id=194551
593
594         Reviewed by Carlos Garcia Campos.
595
596         * SourcesGTK.txt:
597         * SourcesWPE.txt:
598         * UIProcess/glib/WebProcessPoolGLib.cpp: Renamed from Source/WebKit/UIProcess/gtk/WebProcessPoolGtk.cpp.
599         (WebKit::initializeRemoteInspectorServer):
600         (WebKit::memoryPressureMonitorDisabled):
601         (WebKit::WebProcessPool::platformInitialize):
602         (WebKit::WebProcessPool::platformInitializeWebProcess):
603         (WebKit::WebProcessPool::platformInvalidateContext):
604         (WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions):
605         * UIProcess/wpe/WebProcessPoolWPE.cpp: Removed.
606
607 2019-02-13  Michael Catanzaro  <mcatanzaro@igalia.com>
608
609         Fix -Wformat warning from r241401
610         https://bugs.webkit.org/show_bug.cgi?id=194584
611         <rdar://problem/47761293>
612
613         * WebProcess/WebPage/WebPage.cpp:
614         (WebKit::WebPage::setActivityState):
615
616 2019-02-13  Youenn Fablet  <youenn@apple.com>
617
618         Make WebRTCUnifiedPlanEnabled true by default
619         https://bugs.webkit.org/show_bug.cgi?id=194595
620
621         Reviewed by Eric Carlson.
622
623         * Shared/WebPreferences.yaml:
624
625 2019-02-13  John Wilander  <wilander@apple.com>
626
627         Store Ad Click Attribution requests in the network process
628         https://bugs.webkit.org/show_bug.cgi?id=194510
629         <rdar://problem/47650118>
630
631         Reviewed by Alex Christensen and Daniel Bates.
632
633         With this patch, WebPageProxy::didCommitLoadForFrame() now looks for
634         an AdClickAttribution object in its navigation state. If there is an
635         attribution, it sends it to the network process where the 
636         WebKit::NetworkSession stores it in an object of a new class,
637         WebKit::NetworkAdClickAttribution.
638
639         This patch also covers test infrastructure to support two new
640         TestRunner functions:
641         - dumpAdClickAttribution()
642         - clearAdClickAttribution()
643
644         * NetworkProcess/Cookies/WebCookieManager.cpp:
645             Added missing header include.
646         * NetworkProcess/Downloads/DownloadManager.cpp:
647             Added missing header include.
648         * NetworkProcess/NetworkAdClickAttribution.cpp: Added.
649         (WebKit::NetworkAdClickAttribution::ensureDestinationMapForSource):
650         (WebKit::NetworkAdClickAttribution::store):
651         (WebKit::NetworkAdClickAttribution::clear):
652         (WebKit::NetworkAdClickAttribution::toString const):
653         * NetworkProcess/NetworkAdClickAttribution.h: Added.
654             Stores WebCore::AdClickAttribution objects in a map structure.
655         * NetworkProcess/NetworkLoad.cpp:
656             Added missing header includes.
657         * NetworkProcess/NetworkProcess.cpp:
658         (WebKit::NetworkProcess::storeAdClickAttribution):
659         (WebKit::NetworkProcess::dumpAdClickAttribution):
660         (WebKit::NetworkProcess::clearAdClickAttribution):
661         * NetworkProcess/NetworkProcess.h:
662         * NetworkProcess/NetworkProcess.messages.in:
663         * NetworkProcess/NetworkSession.cpp:
664         (WebKit::NetworkSession::NetworkSession):
665         (WebKit::NetworkSession::storeAdClickAttribution):
666         (WebKit::NetworkSession::dumpAdClickAttribution):
667         (WebKit::NetworkSession::clearAdClickAttribution):
668         * NetworkProcess/NetworkSession.h:
669         * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
670             Added missing header include.
671         * Sources.txt:
672             Added NetworkProcess/NetworkAdClickAttribution.cpp.
673         * UIProcess/API/APINavigation.h:
674         (API::Navigation::adClickAttribution const):
675         * UIProcess/API/C/WKPage.cpp:
676         (WKPageDumpAdClickAttribution):
677         (WKPageClearAdClickAttribution):
678             Test infrastructure.
679         * UIProcess/API/C/WKPagePrivate.h:
680         * UIProcess/Network/NetworkProcessProxy.cpp:
681         (WebKit::NetworkProcessProxy::dumpAdClickAttribution):
682         (WebKit::NetworkProcessProxy::clearAdClickAttribution):
683             Test infrastructure.
684         * UIProcess/Network/NetworkProcessProxy.h:
685         * UIProcess/WebPageProxy.cpp:
686         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
687             This is where pending Ad Click Attributions are forwarded to the
688             network process.
689         (WebKit::WebPageProxy::dumpAdClickAttribution):
690         (WebKit::WebPageProxy::clearAdClickAttribution):
691             Test infrastructure.
692         * UIProcess/WebPageProxy.h:
693         * UIProcess/WebProcessPool.cpp:
694         (WebKit::WebProcessPool::dumpAdClickAttribution):
695         (WebKit::WebProcessPool::clearAdClickAttribution):
696             Test infrastructure.
697         * UIProcess/WebProcessPool.h:
698         * WebKit.xcodeproj/project.pbxproj:
699         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
700         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
701             Added missing data copying from navigationAction to navigationActionData.
702
703 2019-02-13  Antti Koivisto  <antti@apple.com>
704
705         Crash in WebKit::CacheStorage::Engine::cachesRootPath
706         https://bugs.webkit.org/show_bug.cgi?id=194588
707         <rdar://problem/46363997>
708
709         Reviewed by Youenn Fablet.
710
711         * NetworkProcess/cache/CacheStorageEngine.cpp:
712         (WebKit::CacheStorage::Engine::cachesRootPath):
713
714         Salt may have not been initialized yet when the Engine is destroyed.
715
716 2019-02-13  Alex Christensen  <achristensen@webkit.org>
717
718         Remove legacy sync messaging in some IPC code
719         https://bugs.webkit.org/show_bug.cgi?id=194561
720
721         Reviewed by Geoffrey Garen.
722
723         Changing some LegacySync messages to Delayed messages.  We should probably rename Delayed to Sync.
724         There are too many ways to send messages.  Let's work to get rid of the old one.
725
726         * NetworkProcess/NetworkProcess.cpp:
727         (WebKit::NetworkProcess::setAllowsAnySSLCertificateForWebSocket):
728         (WebKit::NetworkProcess::processWillSuspendImminently):
729         * NetworkProcess/NetworkProcess.h:
730         * NetworkProcess/NetworkProcess.messages.in:
731         * PluginProcess/PluginControllerProxy.cpp:
732         (WebKit::PluginControllerProxy::handleWheelEvent):
733         (WebKit::PluginControllerProxy::handleMouseEnterEvent):
734         (WebKit::PluginControllerProxy::handleMouseLeaveEvent):
735         (WebKit::PluginControllerProxy::handleKeyboardEvent):
736         (WebKit::PluginControllerProxy::handleEditingCommand):
737         (WebKit::PluginControllerProxy::isEditingCommandEnabled):
738         (WebKit::PluginControllerProxy::handlesPageScaleFactor):
739         (WebKit::PluginControllerProxy::requiresUnifiedScaleFactor):
740         (WebKit::PluginControllerProxy::paintEntirePlugin):
741         (WebKit::PluginControllerProxy::supportsSnapshotting):
742         (WebKit::PluginControllerProxy::snapshot):
743         (WebKit::PluginControllerProxy::getPluginScriptableNPObject):
744         (WebKit::PluginControllerProxy::getFormValue):
745         * PluginProcess/PluginControllerProxy.h:
746         * PluginProcess/PluginControllerProxy.messages.in:
747         * Shared/Plugins/NPObjectMessageReceiver.cpp:
748         (WebKit::NPObjectMessageReceiver::deallocate):
749         (WebKit::NPObjectMessageReceiver::hasMethod):
750         (WebKit::NPObjectMessageReceiver::invoke):
751         (WebKit::NPObjectMessageReceiver::invokeDefault):
752         (WebKit::NPObjectMessageReceiver::hasProperty):
753         (WebKit::NPObjectMessageReceiver::getProperty):
754         (WebKit::NPObjectMessageReceiver::setProperty):
755         (WebKit::NPObjectMessageReceiver::removeProperty):
756         (WebKit::NPObjectMessageReceiver::enumerate):
757         (WebKit::NPObjectMessageReceiver::construct):
758         * Shared/Plugins/NPObjectMessageReceiver.h:
759         * Shared/Plugins/NPObjectMessageReceiver.messages.in:
760         * UIProcess/mac/SecItemShimProxy.cpp:
761         (WebKit::SecItemShimProxy::secItemRequest):
762         * UIProcess/mac/SecItemShimProxy.h:
763         * UIProcess/mac/SecItemShimProxy.messages.in:
764
765 2019-02-13  Truitt Savell  <tsavell@apple.com>
766
767         Unreviewed, rolling out r241433.
768
769         Broke internal builds.
770
771         Reverted changeset:
772
773         "Move
774         UIWebTouchEventsGestureRecognizer.activeTouchesByIdentifier to
775         SPI"
776         https://bugs.webkit.org/show_bug.cgi?id=194531
777         https://trac.webkit.org/changeset/241433
778
779 2019-02-12  Antoine Quint  <graouts@apple.com>
780
781         Move UIWebTouchEventsGestureRecognizer.activeTouchesByIdentifier to SPI
782         https://bugs.webkit.org/show_bug.cgi?id=194531
783         <rdar://problem/47714562>
784
785         Reviewed by Dean Jackson.
786
787         * Platform/spi/ios/UIKitSPI.h:
788         * UIProcess/ios/WKContentViewInteraction.mm:
789         (-[WKContentView cancelPointersForGestureRecognizer:]): We update the referenced Radar since we need to keep the call
790         to respondsToSelector until the SPI has shipped for OpenSource builds to work.
791
792 2019-02-13  Antoine Quint  <graouts@apple.com>
793
794         Support simulated mouse events on iOS based on a PlatformTouchEvent
795         https://bugs.webkit.org/show_bug.cgi?id=194501
796         <rdar://problem/46910790>
797
798         Reviewed by Dean Jackson.
799
800         Add two new internal runtime flags to control whether simulated mouse events should be dipatched along with touch events and whether
801         simulated mousemove events dispatched should automatically trigger the behavior preventDefault() would also trigger. We also ensure
802         that we correctly create touch tracking regions for mouse events.
803
804         * Shared/WebPreferences.yaml:
805         * UIProcess/WebPageProxy.cpp:
806         (WebKit::WebPageProxy::updateTouchEventTracking):
807
808 2019-02-13  Ryosuke Niwa  <rniwa@webkit.org>
809
810         Crash in Page::setActivityState because m_page is null
811         https://bugs.webkit.org/show_bug.cgi?id=194584
812
813         Reviewed by Antti Koivisto.
814
815         Add a null check to avoid the crash. Also add a debug assertion to help diagnose this in the future.
816
817         * WebProcess/WebPage/WebPage.cpp:
818         (WebKit::WebPage::setActivityState):
819
820 2019-02-13  Ryosuke Niwa  <rniwa@webkit.org>
821
822         Release assert in PolicyCheckIdentifier::isValidFor via WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction
823         https://bugs.webkit.org/show_bug.cgi?id=194582
824
825         Reviewed by Antti Koivisto.
826
827         The bug was caused by WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction invoking the callback
828         with responseIdentifier even when we had failed to send the policy check IPC. Clearly, responseIdentifier
829         is invalid in that case, and we should be using requestIdentifier instead.
830
831         Unfortunately no new tests since I'm not aware of a way to make sendSync fail in this case.
832
833         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
834         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
835
836 2019-02-13  Benjamin Poulain  <benjamin@webkit.org>
837
838         Responsiveness timers are too expensive for frequent events
839         https://bugs.webkit.org/show_bug.cgi?id=194003
840
841         Reviewed by Geoffrey Garen.
842
843         With each event, we set a responsivness timer to check if the WebProcess
844         is responsive, and reset the timer when the WebProcess sends an answer.
845
846         For frequent events (e.g. wheel events, mouse force events, etc),
847         we are spamming the kernel with hundreds of timers per second.
848         That is a bit inefficient.
849
850         Another source of inefficiency comes from the timer implementation
851         itself. Stopping a RunLoop::Timer removes the timer from every mode
852         and invalidate the timer. It becomes costly since we do it a lot.
853
854         With this patch, I tweak ResponsivenessTimer and its use to minimize
855         how often we schedule system timers.
856
857         The first change is to not stop the timer when we get the stop()
858         calls if we expect more events to come in. Instead, we keep track
859         if we care about the timeout or not in the attribute "m_waitingForTimer".
860         When the next event starts, we can reschedule the timer without ever
861         having told the kernel about the stop.
862         If there are no next events, the timeout fires but m_waitingForTimer
863         is false. To avoid idle wake up, the lazy stop is only used when having
864         following events is common.
865
866         The second improvements comes from not even rescheduling the timer
867         when restarted. Instead of changing the timer, we let the original timer
868         fire and re-shedule a new one with the missing time.
869
870         For more context, also see patches r240759 and r240944.
871
872         * UIProcess/ResponsivenessTimer.cpp:
873         (WebKit::ResponsivenessTimer::ResponsivenessTimer):
874         (WebKit::ResponsivenessTimer::invalidate):
875         (WebKit::ResponsivenessTimer::timerFired):
876         (WebKit::ResponsivenessTimer::start):
877         (WebKit::ResponsivenessTimer::startWithLazyStop):
878         (WebKit::ResponsivenessTimer::stop):
879         (WebKit::ResponsivenessTimer::processTerminated):
880         (WebKit::ResponsivenessTimer::~ResponsivenessTimer): Deleted.
881         * UIProcess/ResponsivenessTimer.h:
882         (WebKit::ResponsivenessTimer::hasActiveTimer const):
883         * UIProcess/WebPageProxy.cpp:
884         (WebKit::WebPageProxy::processNextQueuedMouseEvent):
885         (WebKit::WebPageProxy::sendWheelEvent):
886         (WebKit::WebPageProxy::handleKeyboardEvent):
887         (WebKit::WebPageProxy::handleGestureEvent):
888         * UIProcess/WebProcessProxy.cpp:
889         (WebKit::WebProcessProxy::isResponsiveWithLazyStop):
890         * UIProcess/WebProcessProxy.h:
891
892 2019-02-12  Tim Horton  <timothy_horton@apple.com>
893
894         Null deref in userInterfaceLayoutDirection under ViewGestureController::handleSwipeGesture
895         https://bugs.webkit.org/show_bug.cgi?id=194569
896         <rdar://problem/46711049>
897
898         Reviewed by Wenson Hsieh.
899
900         * UIProcess/mac/ViewGestureControllerMac.mm:
901         (WebKit::ViewGestureController::handleSwipeGesture):
902         It is conceivable that we could get here if the client closes the page
903         e.g. in the callback from willEndSwipeGesture. We already guarded against
904         this ... one line too late! Rearrange the lines so we don't call into
905         WebPageProxy at all if we don't have a drawing area (which is a strict subset
906         of the time that isValid would return true). This is a speculative fix,
907         since I can no longer reproduce the crash on demand.
908
909 2019-02-12  Youenn Fablet  <youenn@apple.com>
910
911         WebServiceWorkerProvider::handleFetch no longer needs a CachedResource parameter
912         https://bugs.webkit.org/show_bug.cgi?id=194548
913
914         Reviewed by Alex Christensen.
915
916         * WebProcess/Network/WebLoaderStrategy.cpp:
917         (WebKit::WebLoaderStrategy::scheduleLoad):
918         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
919         (WebKit::WebServiceWorkerProvider::handleFetch):
920         * WebProcess/Storage/WebServiceWorkerProvider.h:
921
922 2019-02-12  Tim Horton  <timothy_horton@apple.com>
923
924         Remove WKLegacyPDFView
925         https://bugs.webkit.org/show_bug.cgi?id=194559
926
927         Reviewed by Andy Estes.
928
929         * Platform/spi/ios/CorePDFSPI.h: Removed.
930         * SourcesCocoa.txt:
931         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
932         (-[WKWebViewContentProviderRegistry initWithConfiguration:]):
933         * UIProcess/ios/WKLegacyPDFView.h: Removed.
934         * UIProcess/ios/WKLegacyPDFView.mm: Removed.
935         * WebKit.xcodeproj/project.pbxproj:
936
937 2019-02-12  Chris Dumez  <cdumez@apple.com>
938
939         Regression(PSON) MESSAGE_CHECK() hit under WebPageProxy::didFailProvisionalLoadForFrameShared()
940         https://bugs.webkit.org/show_bug.cgi?id=194568
941         <rdar://problem/47944490>
942
943         Reviewed by Ryosuke Niwa.
944
945         When the provisional process crashes, it is unsafe to call ProvisionalPageProxy::cancel() because
946         the WebProcessProxy clears its frame map as soon as the process crashes. Calling cancel() after
947         that would call WebPageProxy::didFailProvisionalLoadForFrameShared(), which would try to look up
948         the frame by ID and MESSAGE_CHECK() that the frame is not null. We would fail this check since
949         the frame has been removed from the WebProcessProxy at this point.
950
951         * UIProcess/API/Cocoa/WKWebView.mm:
952         (-[WKWebView _provisionalWebProcessIdentifier]):
953         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
954         * UIProcess/WebPageProxy.cpp:
955         (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
956         (WebKit::WebPageProxy::provisionalProcessDidTerminate):
957
958 2019-02-12  Per Arne Vollan  <pvollan@apple.com>
959
960         [iOS] Youtube fails to play.
961         https://bugs.webkit.org/show_bug.cgi?id=194565
962         <rdar://problem/47974770>
963
964         Reviewed by Geoffrey Garen.
965
966         This is caused by sandbox violations and was introduced in r240500.
967
968         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
969
970 2019-02-12  Alex Christensen  <achristensen@webkit.org>
971
972         Remove firing assertion after r241317
973         https://bugs.webkit.org/show_bug.cgi?id=194506
974
975         * WebProcess/Network/WebLoaderStrategy.cpp:
976         (WebKit::WebLoaderStrategy::setDefersLoading):
977         The creation of a PageGroupLoadDeferrer in Chrome.cpp tries to defer loading.
978         See comments in Chrome::runJavaScriptAlert et al.
979         This was necessary with WebKitLegacy, so keep it, but it doesn't need to do anything in modern WebKit.
980
981 2019-02-12  Tim Horton  <timothy_horton@apple.com>
982
983         Find on Page shouldn't zoom in on matches
984         https://bugs.webkit.org/show_bug.cgi?id=194557
985         <rdar://problem/42087017>
986
987         Reviewed by Wenson Hsieh.
988
989         * UIProcess/ios/SmartMagnificationController.h:
990         * UIProcess/ios/SmartMagnificationController.messages.in:
991         * UIProcess/ios/SmartMagnificationController.mm:
992         (WebKit::SmartMagnificationController::scrollToRect):
993         * WebProcess/WebPage/ios/FindControllerIOS.mm:
994         (WebKit::FindController::updateFindIndicator):
995         Only scroll to reveal the find result, do not zoom in.
996
997 2019-02-12  Wenson Hsieh  <wenson_hsieh@apple.com>
998
999         Allow pages to trigger programmatic paste from script on iOS
1000         https://bugs.webkit.org/show_bug.cgi?id=194271
1001         <rdar://problem/47808810>
1002
1003         Reviewed by Tim Horton.
1004
1005         Cancel the pending DOM paste access handler when the menu is about to hide, rather than when the hiding
1006         animation has completed. This ensures that if the page (on behalf of the user) requests DOM paste again during
1007         user interaction before the callout bar has finished fading after the previous DOM paste, we won't automatically
1008         cancel the incoming DOM paste access request because the callout bar animation finished.
1009
1010         This scenario is exercised in the layout test editing/pasteboard/ios/dom-paste-consecutive-confirmations.html.
1011
1012         * Platform/spi/ios/UIKitSPI.h:
1013         * UIProcess/ios/WKContentViewInteraction.mm:
1014         (-[WKContentView setupInteraction]):
1015         (-[WKContentView _willHideMenu:]):
1016         (-[WKContentView _didHideMenu:]):
1017
1018 2019-02-12  Chris Fleizach  <cfleizach@apple.com>
1019
1020         AX: IsolatedTree: Implement more attributes
1021         https://bugs.webkit.org/show_bug.cgi?id=193911
1022         <rdar://problem/47599217>
1023
1024         Reviewed by Daniel Bates.
1025
1026         * Platform/spi/mac/AccessibilityPrivSPI.h: Added.
1027         * WebKit.xcodeproj/project.pbxproj:
1028         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.h:
1029         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
1030         (-[WKAccessibilityWebPageObjectBase clientSupportsIsolatedTree]):
1031         (-[WKAccessibilityWebPageObjectBase isolatedTreeRootObject]):
1032         (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
1033         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
1034         (-[WKAccessibilityWebPageObject IGNORE_WARNINGS_END]):
1035         (-[WKAccessibilityWebPageObject convertScreenPointToRootView:]):
1036         (-[WKAccessibilityWebPageObject accessibilityAttributeValue:]):
1037         (-[WKAccessibilityWebPageObject accessibilityAttributeSizeValue]):
1038         (-[WKAccessibilityWebPageObject accessibilityAttributePositionValue]):
1039         (-[WKAccessibilityWebPageObject accessibilityDataDetectorValue:point:]):
1040         (-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
1041         (-[WKAccessibilityWebPageObject accessibilityHitTest:]):
1042
1043 2019-02-12  Wenson Hsieh  <wenson_hsieh@apple.com>
1044
1045         Allow pages to trigger programmatic paste from script on iOS
1046         https://bugs.webkit.org/show_bug.cgi?id=194271
1047         <rdar://problem/47808810>
1048
1049         Reviewed by Ryosuke Niwa.
1050
1051         * Shared/WebPreferences.yaml:
1052         * Shared/WebPreferencesDefaultValues.h:
1053
1054         Add an internal setting to enable or disable DOM paste access requests. This is on by default in iOS only
1055         (excluding watchOS and Apple TV), and is additionally disabled on macOS.
1056
1057         * UIProcess/API/gtk/PageClientImpl.cpp:
1058         (WebKit::PageClientImpl::requestDOMPasteAccess):
1059         * UIProcess/API/gtk/PageClientImpl.h:
1060         * UIProcess/API/wpe/PageClientImpl.cpp:
1061         (WebKit::PageClientImpl::requestDOMPasteAccess):
1062
1063         Plumb DOM paste access requests from the web process (WebEditorClient) to the view (WKContentView). As per the
1064         usual, this involves WebEditorClient, WebPage, WebPageProxy, PageClient and finally WKContentView.
1065
1066         * UIProcess/API/wpe/PageClientImpl.h:
1067         * UIProcess/PageClient.h:
1068         * UIProcess/WebPageProxy.cpp:
1069         (WebKit::WebPageProxy::requestDOMPasteAccess):
1070         * UIProcess/WebPageProxy.h:
1071         * UIProcess/WebPageProxy.messages.in:
1072         * UIProcess/ios/PageClientImplIOS.h:
1073         * UIProcess/ios/PageClientImplIOS.mm:
1074         (WebKit::PageClientImpl::requestDOMPasteAccess):
1075         * UIProcess/ios/WKContentViewInteraction.h:
1076         * UIProcess/ios/WKContentViewInteraction.mm:
1077         (-[WKContentView setupInteraction]):
1078         (-[WKContentView cleanupInteraction]):
1079         (-[WKContentView resignFirstResponderForWebView]):
1080         (-[WKContentView _webTouchEventsRecognized:]):
1081
1082         Bail from any pending DOM paste access handler the moment we start handling touches on the web view, or if the
1083         web view resigns first responder, or if the web process crashes.
1084
1085         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
1086
1087         Reject text selection gestures while waiting for DOM paste access.
1088
1089         (-[WKContentView canPerformAction:withSender:]):
1090         (-[WKContentView canPerformActionForWebView:withSender:]):
1091
1092         If we're handling a DOM paste, always return YES to allow the callout bar to show the "Paste" option.
1093
1094         (-[WKContentView _didHideMenu:]):
1095
1096         If the menu is programmatically hidden by the app while handling a DOM paste request, immediately reject the DOM
1097         paste request.
1098
1099         (-[WKContentView pasteForWebView:]):
1100
1101         Adjust -pasteForWebView: on WKContentView to first check whether there's an outstanding DOM paste completion
1102         handler to invoke, instead of telling the page to execute a paste command.
1103
1104         (-[WKContentView _handleDOMPasteRequestWithResult:]):
1105
1106         Add a helper to take and invoke the current DOM paste completion handler (if it exists) with the given result,
1107         and then dismiss the shared callout bar. Returns whether or not the paste completion handler exists. Invoked
1108         from various sources of user interaction or significant state changes (e.g. following a web process crash in
1109         -cleanupInteraction).
1110
1111         (-[WKContentView _willPerformAction:sender:]):
1112         (-[WKContentView _didPerformAction:sender:]):
1113
1114         Add hooks to detect when WKContentView is executing an editing action. This is to ensure that the page doesn't
1115         get stuck in a bad state in the case where WKWebView has been subclassed, overrides `-paste:`, and does not
1116         invoke the superclass method (which calls back into `-[WKContentView pasteForWebView:]`). There are a few
1117         possibilities here:
1118         1. WKWebView's `-paste:` action is not overridden. In this case, we will call back into `-pasteForWebView:`,
1119            which will notice that we have a pending paste completion handler and invoke it.
1120         2. WKWebView's `-paste:` action is overridden and does not call back into the content view. In this case, we
1121            will invoke the paste completion handler in `-_didPerformAction:sender:`.
1122         3. WKWebView's `-canPerformAction:withSender:` is overridden to include additional actions. In this case, we may
1123            get a call to invoke a different action selector while waiting for a potential paste action. If this happens,
1124            prevent the DOM paste in `-_willPerformAction:sender:` prior to handling the other action.
1125
1126         (-[WKContentView handleKeyWebEvent:withCompletionHandler:]):
1127
1128         Dismiss DOM paste UI upon handling any key event.
1129
1130         (-[WKContentView showGlobalMenuControllerInRect:]):
1131         (-[WKContentView hideGlobalMenuController]):
1132
1133         Helper methods to present and dismiss the global UIMenuController, that accounts for available platform APIs for
1134         presenting or dismissing the menu controller on iOS.
1135
1136         (-[WKContentView _requestDOMPasteAccessWithElementRect:completionHandler:]):
1137
1138         Attempt to find a good target presentation rect when showing the callout menu. First, we will try to use the
1139         rect of the element the user has interacted with when triggering the paste. If such an element is too large or
1140         does not exist, we fall back to presenting the callout menu near the user's last touch location (with a small
1141         amount of margin, such that the action doesn't overlap with the user's finger, stylus, etc.).
1142
1143         (-[WKContentView _resetShowingTextStyle:]): Deleted.
1144
1145         Rename this to `-_didHideMenu:`.
1146
1147         * UIProcess/mac/PageClientImplMac.h:
1148         * UIProcess/win/PageClientImpl.cpp:
1149         (WebKit::PageClientImpl::requestDOMPasteAccess):
1150         * UIProcess/win/PageClientImpl.h:
1151         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1152         (WebKit::WebEditorClient::requestDOMPasteAccess):
1153         * WebProcess/WebCoreSupport/WebEditorClient.h:
1154         * WebProcess/WebPage/WebPage.cpp:
1155         (WebKit::WebPage::requestDOMPasteAccess):
1156
1157         Add more plumbing and method stubs.
1158
1159         (WebKit::WebPage::updateCurrentModifierState):
1160         (WebKit::WebPage::rectForElementAtInteractionLocation const):
1161         * WebProcess/WebPage/WebPage.h:
1162         * WebProcess/WebPage/ios/WebPageIOS.mm:
1163         (WebKit::WebPage::rectForElementAtInteractionLocation const):
1164         (WebKit::WebPage::rectForElementAtInteractionLocation): Deleted.
1165
1166         Mark this method as const, add a platform-agnostic stub, and adopt it for the purposes of determining where to
1167         position the callout bar when pasting.
1168
1169 2019-02-12  Alex Christensen  <achristensen@webkit.org>
1170
1171         Remove setDefersLoading infrastructure from WebKit2
1172         https://bugs.webkit.org/show_bug.cgi?id=194506
1173
1174         Reviewed by Brady Eidson.
1175
1176         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1177         (WebKit::NetworkConnectionToWebProcess::setDefersLoading): Deleted.
1178         * NetworkProcess/NetworkConnectionToWebProcess.h:
1179         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1180         * NetworkProcess/NetworkDataTask.h:
1181         * NetworkProcess/NetworkDataTaskBlob.cpp:
1182         (WebKit::NetworkDataTaskBlob::suspend): Deleted.
1183         * NetworkProcess/NetworkDataTaskBlob.h:
1184         * NetworkProcess/NetworkLoad.cpp:
1185         (WebKit::NetworkLoad::initialize):
1186         (WebKit::NetworkLoad::setDefersLoading): Deleted.
1187         * NetworkProcess/NetworkLoad.h:
1188         * NetworkProcess/NetworkLoadParameters.h:
1189         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1190         (WebKit::NetworkResourceLoadParameters::encode const):
1191         (WebKit::NetworkResourceLoadParameters::decode):
1192         * NetworkProcess/NetworkResourceLoader.cpp:
1193         (WebKit::NetworkResourceLoader::start):
1194         (WebKit::NetworkResourceLoader::startNetworkLoad):
1195         (WebKit::NetworkResourceLoader::setDefersLoading): Deleted.
1196         * NetworkProcess/NetworkResourceLoader.h:
1197         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
1198         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1199         (WebKit::NetworkDataTaskCocoa::suspend): Deleted.
1200         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
1201         (WebKit::NetworkDataTaskCurl::suspend): Deleted.
1202         * NetworkProcess/curl/NetworkDataTaskCurl.h:
1203         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1204         (WebKit::NetworkDataTaskSoup::suspend): Deleted.
1205         * NetworkProcess/soup/NetworkDataTaskSoup.h:
1206         * WebProcess/Network/WebLoaderStrategy.cpp:
1207         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
1208         (WebKit::WebLoaderStrategy::setDefersLoading):
1209
1210 2019-02-12  Michael Catanzaro  <mcatanzaro@igalia.com>
1211
1212         Unreviewed, fix build warnings after content extensions enablement
1213         https://bugs.webkit.org/show_bug.cgi?id=193622
1214         <rdar://problem/47982850>
1215
1216         * UIProcess/API/C/WKUserContentExtensionStoreRef.cpp:
1217         (toResult):
1218
1219 2019-02-12  Tim Horton  <timothy_horton@apple.com>
1220
1221         Switching focus from a UITextField to an editable WKWebView causes the keyboard to dance
1222         https://bugs.webkit.org/show_bug.cgi?id=194524
1223         <rdar://problem/35481797>
1224
1225         Reviewed by Wenson Hsieh.
1226
1227         * Platform/spi/ios/UIKitSPI.h:
1228         * UIProcess/ios/InputViewUpdateDeferrer.h:
1229         * UIProcess/ios/InputViewUpdateDeferrer.mm:
1230         (WebKit::InputViewUpdateDeferrer::InputViewUpdateDeferrer):
1231         (WebKit::InputViewUpdateDeferrer::~InputViewUpdateDeferrer):
1232         Make use of the per-responder and much safer input view pinning mechanism.
1233
1234         * UIProcess/ios/WKContentViewInteraction.mm:
1235         (-[WKContentView becomeFirstResponderForWebView]):
1236         (-[WKContentView _singleTapCommited:]):
1237         (-[WKContentView _attemptClickAtLocation:modifierFlags:]):
1238         Always temporarily pin input views when becoming first responder; there are
1239         many paths (such as through the text interaction assistant) that can
1240         focus us on tap, trying to cover them all is a fool's errand. We'll
1241         just get out the big hammer and call it in becomeFirstResponder.
1242         This also means we can remove it from _singleTapCommitted and _attemptClick...
1243
1244         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1245         Don't release the input view pinning until we return from _elementDidFocus;
1246         it does the rebuilding synchronously, so we need to have actually updated
1247         all of the prerequisites of -inputView before depinning.
1248
1249 2019-02-12  Youenn Fablet  <youenn@apple.com>
1250
1251         Make use of is<SubresourceLoader>
1252         https://bugs.webkit.org/show_bug.cgi?id=194541
1253
1254         Reviewed by Alex Christensen.
1255
1256         * WebProcess/Network/WebLoaderStrategy.cpp:
1257         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
1258
1259 2019-02-12  Alex Christensen  <achristensen@webkit.org>
1260
1261         WebPage::close needs to remove all message receivers associated with that WebPage, not WebPage::~WebPage
1262         https://bugs.webkit.org/show_bug.cgi?id=194522
1263         <rdar://problem/47789393>
1264
1265         Reviewed by Chris Dumez.
1266
1267         The InjectedBundle SPI can retain the WebPage or wrapping objects (WKWebProcessPlugInBrowserContextController/WKBundlePageRef).
1268         This can make it so WebPage::close is called before WebPage::~WebPage, and if the SuspendedPageProxy is reused for a subsequent
1269         navigation to the same domain, the WebProcess is reused with a different WebPage instance with the same PageID, which causes problems
1270         when another WebPage registers message handlers and then the previous WebPage is destroyed, which removes both message handlers.
1271
1272         * WebProcess/WebPage/WebPage.cpp:
1273         (WebKit::WebPage::~WebPage):
1274         (WebKit::WebPage::close):
1275         (WebKit::WebPage::mainFrameDidLayout):
1276         * WebProcess/WebPage/WebPage.h:
1277         * WebProcess/WebProcess.h:
1278         (WebKit::WebProcess::eventDispatcher):
1279
1280 2019-02-12  Michael Catanzaro  <mcatanzaro@igalia.com>
1281
1282         [WPE][GTK] Unsafe g_unsetenv() use in WebProcessPool::platformInitialize
1283         https://bugs.webkit.org/show_bug.cgi?id=194370
1284
1285         Reviewed by Darin Adler.
1286
1287         It is incorrect to use g_unsetenv() here because it is MT-Unsafe. We know that it is
1288         impossible and unreasonable to expect the application has not started other threads at this
1289         point, and threads will be calling getenv(). WebKit itself has probably already started
1290         threads of its own.
1291
1292         Fortunately, the remote inspector in the web process is already prepared to deal with
1293         failure to connect to the inspector server, so we don't need to do anything except stop
1294         messing with the environment.
1295
1296         Note these files are copies of each other. I'll merge them together in a follow-up patch.
1297
1298         * UIProcess/gtk/WebProcessPoolGtk.cpp:
1299         (WebKit::initializeRemoteInspectorServer):
1300         (WebKit::WebProcessPool::platformInitialize):
1301         * UIProcess/wpe/WebProcessPoolWPE.cpp:
1302         (WebKit::initializeRemoteInspectorServer):
1303         (WebKit::WebProcessPool::platformInitialize):
1304
1305 2019-02-08  Beth Dakin  <bdakin@apple.com>
1306
1307         Ensure old binaries have old snapshotting behaviors
1308         https://bugs.webkit.org/show_bug.cgi?id=194449
1309         -and corresponding-
1310         rdar://problem/47931954
1311
1312         Reviewed by Darin Adler.
1313
1314         Make sure that a nil configuration behaves the same way that it used to on apps 
1315         that were linked before FirstWithSnapshotAfterScreenUpdates
1316
1317         * UIProcess/API/Cocoa/WKWebView.mm:
1318         (-[WKWebView takeSnapshotWithConfiguration:completionHandler:]):
1319         * UIProcess/Cocoa/VersionChecks.h:
1320
1321 2019-02-12  Andy Estes  <aestes@apple.com>
1322
1323         [iOSMac] Enable Parental Controls Content Filtering
1324         https://bugs.webkit.org/show_bug.cgi?id=194521
1325         <rdar://39732376>
1326
1327         Reviewed by Tim Horton.
1328
1329         * Configurations/FeatureDefines.xcconfig:
1330
1331 2019-02-11  Alex Christensen  <achristensen@webkit.org>
1332
1333         Remove noisy and unnecessary logs added in r241223
1334         https://bugs.webkit.org/show_bug.cgi?id=194427
1335
1336         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1337         (WebKit::ProcessLauncher::launchProcess):
1338         Errors occur all the time in the XPC connection's event handler, like when a process terminates.
1339         We don't need to print an "error" every time any process terminates.
1340
1341 2019-02-11  Brian Burg  <bburg@apple.com>
1342
1343         [Cocoa] Web Automation: client callbacks are not called if delegate does not override
1344         https://bugs.webkit.org/show_bug.cgi?id=194519
1345         <rdar://problem/47981961>
1346
1347         Reviewed by Joseph Pecoraro.
1348
1349         Call the completion handler directly if the delegate does not implement the relevant method.
1350
1351         * UIProcess/Cocoa/AutomationSessionClient.mm:
1352         (WebKit::AutomationSessionClient::requestNewPageWithOptions):
1353         (WebKit::AutomationSessionClient::requestSwitchToPage):
1354         (WebKit::AutomationSessionClient::requestHideWindowOfPage):
1355         (WebKit::AutomationSessionClient::requestRestoreWindowOfPage):
1356         (WebKit::AutomationSessionClient::requestMaximizeWindowOfPage):
1357
1358 2019-02-11  Daniel Bates  <dabates@apple.com>
1359
1360         [iOS] Adopt SPI to support Emacs bindings: transpose and delete to end of paragraph
1361         https://bugs.webkit.org/show_bug.cgi?id=194505
1362         <rdar://problem/47743533>
1363
1364         Reviewed by Tim Horton.
1365
1366         * UIProcess/ios/WKContentViewInteraction.mm:
1367         (-[WKContentView _deleteToEndOfParagraph]): Added.
1368         (-[WKContentView _transpose]): Added.
1369
1370 2019-02-11  Adrian Perez de Castro  <aperez@igalia.com>
1371
1372         [GTK][WPE] Add content extensions support in WKTR and unskip layout tests
1373         https://bugs.webkit.org/show_bug.cgi?id=193622
1374
1375         Reviewed by Michael Catanzaro.
1376
1377         * NetworkProcess/cache/NetworkCacheData.h: Define an adoptAndMapFile() implementation
1378         for GFileIOStream objects.
1379         * NetworkProcess/cache/NetworkCacheDataSoup.cpp:
1380         (WebKit::NetworkCache::adoptAndMapFile): Added implementation, which extracts the file
1381         descriptor from a GFileIOStream, as it inherits from GFileDescriptorBased, and then
1382         reuses the version of adoptAndMapFile() which takes a file descritor for the actual work.
1383         * NetworkProcess/NetworkLoadChecker.cpp:
1384         (Webkit::NetworkLoadChecker::checkRequest): Use "this" when referring to
1385         processContentExtensionRulesForLoad() in order to avoid ambiguity.
1386         * Sources.txt: Add WKUserContentExtensionStoreRef.cpp, all ports use it now.
1387         * SourcesCocoa.txt: Remove WKUserContentExtensionStoreRef.cpp, because it is not
1388         Cocoa-specific anymore.
1389         * SourcesGTK.txt: Add APIContentRuleListStoreGLib.cpp.
1390         * SourcesWPE.txt: Ditto.
1391         * UIProcess/API/C/WKUserContentExtensionStoreRef.cpp:
1392         (WKUserContentExtensionStoreCreate): Added.
1393         (toResult): Added.
1394         (WKUserContentExtensionStoreCompile): Added.
1395         (WKUserContentExtensionStoreLookup): Added.
1396         (WKUserContentExtensionStoreRemove): Added.
1397         * UIProcess/API/C/WKUserContentExtensionStoreRef.h: Add declarations for the new C API
1398         functions and for the WKUserContentExtensionStoreResult status enum.
1399         * UIProcess/API/glib/APIContentRuleListStoreGLib.cpp: Added.
1400         (API::ContentRuleListStore::defaultStorePath): Add a dummy implementation. The public API
1401         for the GLib based ports (GTK+ and WPE) will not allow using the default store and will
1402         always indicating a path.
1403
1404 2019-02-11  Daniel Bates  <dabates@apple.com>
1405
1406         [iOS] Mouse/Touch/Pointer events are missing modifier keys
1407         https://bugs.webkit.org/show_bug.cgi?id=191446
1408         <rdar://problem/45929460>
1409
1410         Reviewed by Tim Horton.
1411
1412         Make use of UIKit SPI to retreive the modifier flags when dispatching mouse and touch events.
1413         Add new WebKit SPI for iOS, -[WKNavigationAction modifierFlags], to retrieve the the modifier
1414         flags held when a navigation action was initiated.
1415
1416         * Platform/spi/ios/UIKitSPI.h: Expose SPI.
1417         * Shared/NativeWebTouchEvent.h: Re-arrange macro guards so that we can expose the helper function
1418         WebKit::webEventModifierFlags(). This is a bit more involved that usual since this header is included
1419         from both C++ and Objective-C source files. It only makes sense to expose this function when
1420         compiling as part of an Objective-C source file.
1421         * Shared/ios/NativeWebTouchEventIOS.mm:
1422         (WebKit::NativeWebTouchEvent::NativeWebTouchEvent): Modified to take the modifier flags held down
1423         when the platform touch event was received and pass them through to the base constructor.
1424         (WebKit::webEventModifierFlags): Added. Converts from the platform-speciifc UIKeyModifierFlags to
1425         OptionSet<WebKit::WebEvent::Modifier>.
1426         * Shared/ios/WebIOSEventFactory.h:
1427         * Shared/ios/WebIOSEventFactory.mm:
1428         (WebIOSEventFactory::toUIKeyModifierFlags): Added. Converts from OptionSet<WebKit::WebEvent::Modifier>
1429         to the platform-specific UIKeyModifierFlags.
1430         * UIProcess/API/Cocoa/WKNavigationAction.mm:
1431         (-[WKNavigationAction modifierFlags]): Added.
1432         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
1433         * UIProcess/WebPageProxy.h:
1434         * UIProcess/ios/WKContentViewInteraction.h:
1435         * UIProcess/ios/WKContentViewInteraction.mm:
1436         (gestureRecognizerModifierFlags): Added.
1437
1438         (-[WKContentView _webTouchEventsRecognized:]):
1439         (-[WKContentView _highlightLongPressRecognized:]):
1440         (-[WKContentView _twoFingerSingleTapGestureRecognized:]):
1441         (-[WKContentView _singleTapCommited:]):
1442         Pass modifier flags through.
1443
1444         (-[WKContentView _attemptClickAtLocation:modifierFlags:]): Added.
1445         (-[WKContentView actionSheetAssistant:openElementAtLocation:]): This is invoked when a person opens a link
1446         via the action sheet. We don't have access to the modifier flags to pass. It also seems like an implementation
1447         detail that this action is implemented via mouse click and we should re-evaluate this decision in light of
1448         the fact tht the action sheet is browser UI and we tend to be very reserved on what UI actions are visible
1449         to the page. On Mac, opening a link via the context menu is not visible to the page, at least from a mouse
1450         event perspective.
1451         (webEventFlagsForUIKeyModifierFlags): Added.
1452         (-[WKContentView _hoverGestureRecognizerChanged:]): Pass modifier flags through.
1453         (-[WKContentView _attemptClickAtLocation:]): Deleted.
1454         * UIProcess/ios/WebPageProxyIOS.mm:
1455         (WebKit::WebPageProxy::handleTwoFingerTapAtPoint):
1456         (WebKit::WebPageProxy::commitPotentialTap):
1457         (WebKit::WebPageProxy::handleTap):
1458         * WebProcess/WebPage/WebPage.h:
1459         * WebProcess/WebPage/WebPage.messages.in:
1460         * WebProcess/WebPage/ios/WebPageIOS.mm:
1461         (WebKit::WebPage::handleSyntheticClick):
1462         (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
1463         (WebKit::WebPage::completeSyntheticClick):
1464         (WebKit::WebPage::handleTap):
1465         (WebKit::WebPage::handleTwoFingerTapAtPoint):
1466         (WebKit::WebPage::commitPotentialTap):
1467         Pass modifier flags through.
1468
1469 2019-02-11  Jer Noble  <jer.noble@apple.com>
1470
1471         [Cocoa] Notify AVSystemController of our presenting PID before registering as a Now Playing app.
1472         https://bugs.webkit.org/show_bug.cgi?id=194504
1473
1474         Reviewed by Eric Carlson.
1475
1476         * WebKit.xcodeproj/project.pbxproj:
1477         * WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
1478         (WebKit::WebUserMediaClient::requestUserMediaAccess):
1479         * WebProcess/WebPage/WebPage.cpp:
1480         (WebKit::WebPage::prepareToSendUserMediaPermissionRequest): Deleted.
1481         * WebProcess/WebPage/WebPage.h:
1482         (WebKit::WebPage::userMediaPermissionRequestManager):
1483         * WebProcess/WebPage/ios/WebPageIOS.mm:
1484         (WebKit::WebPage::prepareToSendUserMediaPermissionRequest): Deleted.
1485
1486 2019-02-11  Commit Queue  <commit-queue@webkit.org>
1487
1488         Unreviewed, rolling out r241272 and r241276.
1489         https://bugs.webkit.org/show_bug.cgi?id=194514
1490
1491         Broke the Apple Internal build and the fix requires human
1492         intervention :( (Requested by dydz on #webkit).
1493
1494         Reverted changesets:
1495
1496         "[iOS] Mouse/Touch/Pointer events are missing modifier keys"
1497         https://bugs.webkit.org/show_bug.cgi?id=191446
1498         https://trac.webkit.org/changeset/241272
1499
1500         "Fix internal iOS build after r241272"
1501         https://bugs.webkit.org/show_bug.cgi?id=191446
1502         https://trac.webkit.org/changeset/241276
1503
1504 2019-02-11  Alex Christensen  <achristensen@webkit.org>
1505
1506         Fix internal iOS build after r241272
1507         https://bugs.webkit.org/show_bug.cgi?id=191446
1508
1509         * Platform/spi/ios/UIKitSPI.h:
1510         Declare the _modifierFlags when using the internal SDK also.
1511
1512 2019-02-11  Wenson Hsieh  <wenson_hsieh@apple.com>
1513
1514         fast/forms/ios/force-gregorian-calendar-for-credit-card-expiry.html does not work on iPad
1515         https://bugs.webkit.org/show_bug.cgi?id=194313
1516
1517         Reviewed by Tim Horton.
1518
1519         Make `-dateTimePickerCalendarType` work on iPad by handling the case where the date picker control is a
1520         WKDateTimePopover. This fixes UIScriptController::calendarType() returning null on iPad.
1521
1522         * UIProcess/ios/forms/WKFormInputControl.mm:
1523         (-[WKFormInputControl dateTimePickerCalendarType]):
1524         (-[WKDateTimePopover calendarType]):
1525
1526 2019-02-11  Daniel Bates  <dabates@apple.com>
1527
1528         [iOS] Mouse/Touch/Pointer events are missing modifier keys
1529         https://bugs.webkit.org/show_bug.cgi?id=191446
1530         <rdar://problem/45929460>
1531
1532         Reviewed by Tim Horton.
1533
1534         Make use of UIKit SPI to retreive the modifier flags when dispatching mouse and touch events.
1535         Add new WebKit SPI for iOS, -[WKNavigationAction modifierFlags], to retrieve the the modifier
1536         flags held when a navigation action was initiated.
1537
1538         * Platform/spi/ios/UIKitSPI.h: Expose SPI.
1539         * Shared/NativeWebTouchEvent.h: Re-arrange macro guards so that we can expose the helper function
1540         WebKit::webEventModifierFlags(). This is a bit more involved that usual since this header is included
1541         from both C++ and Objective-C source files. It only makes sense to expose this function when
1542         compiling as part of an Objective-C source file.
1543         * Shared/ios/NativeWebTouchEventIOS.mm:
1544         (WebKit::NativeWebTouchEvent::NativeWebTouchEvent): Modified to take the modifier flags held down
1545         when the platform touch event was received and pass them through to the base constructor.
1546         (WebKit::webEventModifierFlags): Added. Converts from the platform-speciifc UIKeyModifierFlags to
1547         OptionSet<WebKit::WebEvent::Modifier>.
1548         * Shared/ios/WebIOSEventFactory.h:
1549         * Shared/ios/WebIOSEventFactory.mm:
1550         (WebIOSEventFactory::toUIKeyModifierFlags): Added. Converts from OptionSet<WebKit::WebEvent::Modifier>
1551         to the platform-specific UIKeyModifierFlags.
1552         * UIProcess/API/Cocoa/WKNavigationAction.mm:
1553         (-[WKNavigationAction modifierFlags]): Added.
1554         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
1555         * UIProcess/WebPageProxy.h:
1556         * UIProcess/ios/WKContentViewInteraction.h:
1557         * UIProcess/ios/WKContentViewInteraction.mm:
1558         (gestureRecognizerModifierFlags): Added.
1559
1560         (-[WKContentView _webTouchEventsRecognized:]):
1561         (-[WKContentView _highlightLongPressRecognized:]):
1562         (-[WKContentView _twoFingerSingleTapGestureRecognized:]):
1563         (-[WKContentView _singleTapCommited:]):
1564         Pass modifier flags through.
1565
1566         (-[WKContentView _attemptClickAtLocation:modifierFlags:]): Added.
1567         (-[WKContentView actionSheetAssistant:openElementAtLocation:]): This is invoked when a person opens a link
1568         via the action sheet. We don't have access to the modifier flags to pass. It also seems like an implementation
1569         detail that this action is implemented via mouse click and we should re-evaluate this decision in light of
1570         the fact tht the action sheet is browser UI and we tend to be very reserved on what UI actions are visible
1571         to the page. On Mac, opening a link via the context menu is not visible to the page, at least from a mouse
1572         event perspective.
1573         (webEventFlagsForUIKeyModifierFlags): Added.
1574         (-[WKContentView _hoverGestureRecognizerChanged:]): Pass modifier flags through.
1575         (-[WKContentView _attemptClickAtLocation:]): Deleted.
1576         * UIProcess/ios/WebPageProxyIOS.mm:
1577         (WebKit::WebPageProxy::handleTwoFingerTapAtPoint):
1578         (WebKit::WebPageProxy::commitPotentialTap):
1579         (WebKit::WebPageProxy::handleTap):
1580         * WebProcess/WebPage/WebPage.h:
1581         * WebProcess/WebPage/WebPage.messages.in:
1582         * WebProcess/WebPage/ios/WebPageIOS.mm:
1583         (WebKit::WebPage::handleSyntheticClick):
1584         (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
1585         (WebKit::WebPage::completeSyntheticClick):
1586         (WebKit::WebPage::handleTap):
1587         (WebKit::WebPage::handleTwoFingerTapAtPoint):
1588         (WebKit::WebPage::commitPotentialTap):
1589         Pass modifier flags through.
1590
1591 2019-02-11  Youenn Fablet  <youenn@apple.com>
1592
1593         Filter out Overconstrainederror.constraint when getUserMedia is not granted
1594         https://bugs.webkit.org/show_bug.cgi?id=194240
1595
1596         Reviewed by Eric Carlson.
1597
1598         Make sure in UIProcess to filter out constraint if either the page was not granted gum access or it has no persistent access.
1599
1600         Refactor UserMediaPermissionRequestManagerProxy to make the implementation easier to understand.
1601
1602         Covered by added test.
1603
1604         * UIProcess/UserMediaPermissionCheckProxy.cpp:
1605         (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo):
1606         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1607         (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
1608         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
1609         (WebKit::UserMediaPermissionRequestManagerProxy::grantAccess):
1610         (WebKit::UserMediaPermissionRequestManagerProxy::getRequestAction):
1611         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
1612         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionRequest):
1613         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionInvalidRequest):
1614         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionValidRequest):
1615         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
1616         (WebKit::UserMediaPermissionRequestManagerProxy::wasGrantedVideoOrAudioAccess):
1617         (WebKit::UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList):
1618         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
1619         (WebKit::UserMediaPermissionRequestManagerProxy::createPermissionRequest): Deleted.
1620         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1621         * UIProcess/UserMediaPermissionRequestProxy.h:
1622         (WebKit::UserMediaPermissionRequestProxy::isPending const):
1623         (WebKit::UserMediaPermissionRequestProxy::setEligibleVideoDeviceUIDs):
1624         (WebKit::UserMediaPermissionRequestProxy::setEligibleAudioDeviceUIDs):
1625         (WebKit::UserMediaPermissionRequestProxy::hasAudioDevice const):
1626         (WebKit::UserMediaPermissionRequestProxy::hasVideoDevice const):
1627         (WebKit::UserMediaPermissionRequestProxy::hasPersistentAccess const):
1628         (WebKit::UserMediaPermissionRequestProxy::setHasPersistentAccess):
1629         (WebKit::UserMediaPermissionRequestProxy::userMediaID const):
1630         (WebKit::UserMediaPermissionRequestProxy::topLevelDocumentSecurityOrigin const):
1631         (WebKit::UserMediaPermissionRequestProxy::userMediaDocumentSecurityOrigin const):
1632         (WebKit::UserMediaPermissionRequestProxy::userRequest const):
1633         (WebKit::UserMediaPermissionRequestProxy::setDeviceIdentifierHashSalt):
1634         (WebKit::UserMediaPermissionRequestProxy::deviceIdentifierHashSalt const):
1635         (WebKit::UserMediaPermissionRequestProxy::audioDevice const):
1636         (WebKit::UserMediaPermissionRequestProxy::videoDevice const):
1637         * UIProcess/WebPageProxy.cpp:
1638         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
1639         * UIProcess/WebPageProxy.h:
1640
1641 2019-02-11  Carlos Garcia Campos  <cgarcia@igalia.com>
1642
1643         [WPE] Do not try to create empty egl windows
1644         https://bugs.webkit.org/show_bug.cgi?id=194497
1645
1646         Reviewed by Žan Doberšek.
1647
1648         In AcceleratedSurfaceWPE we ensure the size we pass to wpe is at least 0x0, but wl_egl_window_create() returns
1649         nullptr if 0 is passed as width or height. We should use at least 1x1 instead.
1650
1651         * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
1652         (WebKit::AcceleratedSurfaceWPE::initialize):
1653         (WebKit::AcceleratedSurfaceWPE::clientResize):
1654
1655 2019-02-10  Carlos Garcia Campos  <cgarcia@igalia.com>
1656
1657         [WPE] Do not use a sync IPC message to send the host FD to the web process
1658         https://bugs.webkit.org/show_bug.cgi?id=194216
1659
1660         Reviewed by Darin Adler.
1661
1662         It can be sent as a web page creation parameter instead.
1663
1664         * PlatformWPE.cmake:
1665         * Shared/WebPageCreationParameters.cpp:
1666         (WebKit::WebPageCreationParameters::encode const):
1667         (WebKit::WebPageCreationParameters::decode):
1668         * Shared/WebPageCreationParameters.h:
1669         * SourcesWPE.txt:
1670         * UIProcess/API/wpe/CompositingManagerProxy.cpp: Removed.
1671         * UIProcess/API/wpe/CompositingManagerProxy.h: Removed.
1672         * UIProcess/API/wpe/CompositingManagerProxy.messages.in: Removed.
1673         * UIProcess/API/wpe/PageClientImpl.cpp:
1674         (WebKit::PageClientImpl::hostFileDescriptor):
1675         * UIProcess/API/wpe/PageClientImpl.h:
1676         * UIProcess/API/wpe/WPEView.cpp:
1677         (WKWPE::m_backend):
1678         * UIProcess/API/wpe/WPEView.h:
1679         (WKWPE::View::create):
1680         * UIProcess/PageClient.h:
1681         * UIProcess/WebPageProxy.cpp:
1682         (WebKit::WebPageProxy::creationParameters):
1683         * WebProcess/WebPage/WebPage.cpp:
1684         (WebKit::m_hostFileDescriptor):
1685         * WebProcess/WebPage/WebPage.h:
1686         (WebKit::WebPage::releaseHostFileDescriptor):
1687         * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
1688         (WebKit::AcceleratedSurfaceWPE::AcceleratedSurfaceWPE):
1689         (WebKit::AcceleratedSurfaceWPE::initialize):
1690         * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.h:
1691         * WebProcess/WebPage/wpe/CompositingManager.cpp: Removed.
1692         * WebProcess/WebPage/wpe/CompositingManager.h: Removed.
1693
1694 2019-02-04  Carlos Garcia Campos  <cgarcia@igalia.com>
1695
1696         [GTK][WPE] Add enable-javascript-markup setting
1697         https://bugs.webkit.org/show_bug.cgi?id=193439
1698
1699         Reviewed by Michael Catanzaro.
1700
1701         Expose JavaScriptMarkupEnabled setting in the GLib API.
1702
1703         * UIProcess/API/glib/WebKitSettings.cpp:
1704         (webKitSettingsSetProperty):
1705         (webKitSettingsGetProperty):
1706         (webkit_settings_class_init):
1707         (webkit_settings_get_enable_javascript_markup):
1708         (webkit_settings_set_enable_javascript_markup):
1709         * UIProcess/API/gtk/WebKitSettings.h:
1710         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1711         * UIProcess/API/wpe/WebKitSettings.h:
1712         * UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
1713
1714 2019-02-10  Darin Adler  <darin@apple.com>
1715
1716         Switch uses of StringBuilder with String::format for hex numbers to use HexNumber.h instead
1717         https://bugs.webkit.org/show_bug.cgi?id=194485
1718
1719         Reviewed by Daniel Bates.
1720
1721         * UIProcess/DeviceIdHashSaltStorage.cpp:
1722         (WebKit::DeviceIdHashSaltStorage::completeDeviceIdHashSaltForOriginCall): Use
1723         appendUnsignedAsHex instead of appendUnsigned64AsHex.
1724
1725         * UIProcess/WebBackForwardList.cpp:
1726         (WebKit::WebBackForwardList::loggingString): Use appendUnsignedAsHex and
1727         reinterpret_cast<uintptr_t> instead of String::format and "%p".
1728
1729 2019-02-10  Commit Queue  <commit-queue@webkit.org>
1730
1731         Unreviewed, rolling out r241167.
1732         https://bugs.webkit.org/show_bug.cgi?id=194482
1733
1734         Broke the GTK mediastream tests (Requested by philn on
1735         #webkit).
1736
1737         Reverted changeset:
1738
1739         "Filter out Overconstrainederror.constraint when getUserMedia
1740         is not granted"
1741         https://bugs.webkit.org/show_bug.cgi?id=194240
1742         https://trac.webkit.org/changeset/241167
1743
1744 2019-02-09  Darin Adler  <darin@apple.com>
1745
1746         Eliminate unnecessary String temporaries by using StringConcatenateNumbers
1747         https://bugs.webkit.org/show_bug.cgi?id=194021
1748
1749         Reviewed by Geoffrey Garen.
1750
1751         * NetworkProcess/NetworkResourceLoader.cpp:
1752         (WebKit::escapeIDForJSON): Use an ASCIILiteral to create a String.
1753
1754         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1755         (WebKit::NetworkCache::makeVersionedDirectoryPath): Remove String::number and let
1756         makeString do the conversion without allocating/destroying a String.
1757
1758         * NetworkProcess/mac/RemoteNetworkingContext.mm: Removed "using namespace WebCore".
1759         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): Remove String::number
1760         and let makeString do the conversion without allocating/destroying a String.
1761
1762         * NetworkProcess/webrtc/NetworkMDNSRegister.cpp: Removed "using namespace WebCore".
1763         (WebKit::registerMDNSNameCallback): Added explicit WebCore prefix as needed.
1764         (WebKit::NetworkMDNSRegister::registerMDNSName): Ditto. Also remove String::number
1765         and let makeString do the conversion without allocating/destroying a String.
1766
1767         * UIProcess/WebPageGroup.cpp:
1768         (WebKit::pageGroupData): Remove String::number and let makeString do the conversion
1769         without allocating/destroying a String.
1770         * UIProcess/WebPageProxy.cpp:
1771         (WebKit::WebPageProxy::createInspectorTargets): Ditto.
1772         * UIProcess/ios/WKLegacyPDFView.mm:
1773         (-[WKLegacyPDFView _URLForLinkAnnotation:]): Ditto.
1774         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
1775         (WebKit::uniqueWorldName): Ditto.
1776         * WebProcess/WebPage/WebPageInspectorTarget.cpp:
1777         (WebKit::WebPageInspectorTarget::identifier const): Ditto.
1778
1779 2019-02-09  Alexander Mikhaylenko  <exalm7659@gmail.com>
1780
1781         [GTK] Fix typo in the newly added API
1782         https://bugs.webkit.org/show_bug.cgi?id=194472
1783
1784         Reviewed by Michael Catanzaro.
1785
1786         Fix a typo: enableed -> enabled.
1787
1788         * UIProcess/API/glib/WebKitSettings.cpp:
1789         (webkit_settings_set_enable_back_forward_navigation_gestures):
1790         * UIProcess/API/gtk/WebKitSettings.h:
1791
1792 2019-02-08  Alex Christensen  <achristensen@webkit.org>
1793
1794         Speculative fix for Mojave API test after r241223
1795         https://bugs.webkit.org/show_bug.cgi?id=194427
1796
1797         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
1798         (WebKit::XPCInitializationHandler):
1799         (WebKit::XPCServiceMain):
1800         Set the __APPLEEVENTSSERVICENAME environment variable before handling any xpc messages like we used to.
1801         I'll worry about making things right in the daemon later.
1802
1803 2019-02-08  Chris Dumez  <cdumez@apple.com>
1804
1805         [WK2][macOS] Avoid creating new CVDisplayLink objects for each WebProcess
1806         https://bugs.webkit.org/show_bug.cgi?id=194463
1807
1808         Reviewed by Tim Horton.
1809
1810         Avoid creating new CVDisplayLink objects for each WebProcess. We really only need one per
1811         display, creating such object is expensive and it is even worse in a PSON world where we
1812         swap process on navigation.
1813
1814         This patch moves the DisplayLink storing from WebProcessProxy to WebProcessPool. Also,
1815         a DisplayLink can now be associated to several IPC connections instead of having a 1:1
1816         mapping. When a DisplayLink no longer has any observers, we now merely stop it instead
1817         of destroying it.
1818
1819         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1820         (WebKit::WebProcessPool::startDisplayLink):
1821         (WebKit::WebProcessPool::stopDisplayLink):
1822         (WebKit::WebProcessPool::stopDisplayLinks):
1823         * UIProcess/WebProcessPool.h:
1824         * UIProcess/WebProcessProxy.cpp:
1825         (WebKit::WebProcessProxy::~WebProcessProxy):
1826         (WebKit::WebProcessProxy::processWillShutDown):
1827         (WebKit::WebProcessProxy::shutDown):
1828         * UIProcess/WebProcessProxy.h:
1829         * UIProcess/mac/DisplayLink.cpp:
1830         (WebKit::DisplayLink::DisplayLink):
1831         (WebKit::DisplayLink::addObserver):
1832         (WebKit::DisplayLink::removeObserver):
1833         (WebKit::DisplayLink::removeObservers):
1834         (WebKit::DisplayLink::hasObservers const):
1835         (WebKit::DisplayLink::displayLinkCallback):
1836         * UIProcess/mac/DisplayLink.h:
1837         * UIProcess/mac/WebProcessProxyMac.mm:
1838         (WebKit::WebProcessProxy::startDisplayLink):
1839         (WebKit::WebProcessProxy::stopDisplayLink):
1840
1841 2019-02-08  Alexander Mikhaylenko  <exalm7659@gmail.com>
1842
1843         [GTK] Implement back/forward touchpad gesture
1844         https://bugs.webkit.org/show_bug.cgi?id=193919
1845
1846         Reviewed by Michael Catanzaro.
1847
1848         Move ViewSnapshotStore and ViewGestureController from Cocoa/Mac directory
1849         to UIProcess/, also move some parts of mac/ViewGestreControllerMac.mm to
1850         ViewGestureController.cpp, split up Mac- and iOS-specific parts of
1851         ViewSnapshotStore.cpp into mac/ViewSnapshotMac.mm, then implement 2-finger
1852         touchpad swipe back-forward gesture for GTK based on that.
1853
1854         To avoid name conflict, rename existing ViewGestureController class inside
1855         UIProcess/API/gtk/WebKitWebViewBase.cpp into TouchGestureController.
1856
1857         Since GTK gestures can only work with 3 or 4 fingers, treat horizontal
1858         scrolling events as a swipe as long as there's nowhere to scroll in that
1859         direction and web page doesn't handle the scrolling.
1860
1861         This is only allowed for touchpads, even though it can theoretically work
1862         with touch mice and trackpoints.
1863
1864         The gesture requires every item in back-forward list to have a snapshot.
1865         There's already an existing infrastructure for that, so the patch changes
1866         a bunch of #if PLATFORM(COCOA) statements to also check for GTK platform.
1867         The snapshots have to be taken in sync, so the implementation draws webview
1868         widget into a Cairo image surface.
1869
1870         The gesture is disabled by default, and can be enabled by setting the newly
1871         added 'enable-back-forward-navigation-gestures' property in WebKitSettings to
1872         true.
1873
1874         Gesture drawing is implemented via Cairo. When the gesture is active, the
1875         actual page is drawn into a Cairo group, which is then drawn together with
1876         a given snapshot, as well as dimming and a drop shadow over the "lower" layer.
1877
1878         Also add a memory pressure handler that clears snapshot store when low on memory.
1879
1880         * DerivedSources-input.xcfilelist:
1881         * PlatformGTK.cmake:
1882         * PlatformMac.cmake:
1883         * Shared/SessionState.h: Add snapshot to back-forward items for GTK.
1884         * Shared/WebBackForwardListItem.h: Add snapshot to back-forward items for GTK.
1885         * SourcesCocoa.txt:
1886         * SourcesGTK.txt:
1887         * UIProcess/API/glib/WebKitSettings.cpp:
1888         Added 'enable-back-forward-navigation-gestures' property for enabling the gesture.
1889         (webKitSettingsSetProperty):
1890         (webKitSettingsGetProperty):
1891         (webkit_settings_class_init):
1892         (webkit_settings_get_enable_back_forward_navigation_gestures): Added, GTK only.
1893         (webkit_settings_set_enable_back_forward_navigation_gestures): Added, GTK only.
1894         * UIProcess/API/glib/WebKitWebView.cpp:
1895         (enableBackForwardNavigationGesturesChanged): Added, GTK only.
1896         (webkitWebViewUpdateSettings):
1897         (webkitWebViewDisconnectSettingsSignalHandlers):
1898         * UIProcess/API/gtk/PageClientImpl.cpp:
1899         (WebKit::PageClientImpl::setViewNeedsDisplay): Redraw the whole screen instead of a region during the gesture.
1900         (WebKit::PageClientImpl::takeViewSnapshot): Added.
1901         (WebKit::PageClientImpl::wheelEventWasNotHandledByWebCore): Pass unhandled events to the gesture controller.
1902         (WebKit::PageClientImpl::didRemoveNavigationGestureSnapshot): Redraw the widget immediately after removing snapshot.
1903         (WebKit::PageClientImpl::didStartProvisionalLoadForMainFrame): Added, send a notification to the gesture controller.
1904         (WebKit::PageClientImpl::didFirstVisuallyNonEmptyLayoutForMainFrame):  Send a notification to the gesture controller.
1905         (WebKit::PageClientImpl::didFinishLoadForMainFrame):  Send a notification to the gesture controller.
1906         (WebKit::PageClientImpl::didFailLoadForMainFrame):  Added, send a notification to the gesture controller.
1907         (WebKit::PageClientImpl::didSameDocumentNavigationForMainFrame):  Send a notification to the gesture controller.
1908         (WebKit::PageClientImpl::didRestoreScrollPosition):  Added, send a notification to the gesture controller.
1909         * UIProcess/API/gtk/PageClientImpl.h:
1910         * UIProcess/API/gtk/WebKitSettings.h:
1911         Add webkit_settings_get_enable_back_forward_navigation_gestures() and webkit_settings_get_enable_back_forward_navigation_gestures()
1912         to public API.
1913         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1914         (webkitWebViewBaseDraw): Pass drawing to ViewGestureController during the gesture.
1915         (webkitWebViewBaseScrollEvent): Pass scroll events to ViewGestureController during the gesture.
1916         (webkitWebViewBaseGestureController): Renamed ViewGestureController to TouchGestureController.
1917         (webkitWebViewBaseViewGestureController): Added.
1918         (webkitWebViewBaseCreateWebPage): Create an instance of ViewGestureController.
1919         (webkitWebViewBaseTakeViewSnapshot): Added.
1920         (webkitWebViewBaseDidStartProvisionalLoadForMainFrame): Added.
1921         (webkitWebViewBaseDidFirstVisuallyNonEmptyLayoutForMainFrame): Added.
1922         (webkitWebViewBaseDidFinishLoadForMainFrame): Added.
1923         (webkitWebViewBaseDidFailLoadForMainFrame): Added.
1924         (webkitWebViewBaseDidSameDocumentNavigationForMainFrame): Added.
1925         (webkitWebViewBaseDidRestoreScrollPosition): Added.
1926         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
1927         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Mentioned the added functions in docs.
1928         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1929         (WebKit::WebProcessPool::platformInitialize): Move the check from WebMemoryPressureHandlerCocoa.mm here.
1930         * UIProcess/PageClient.h: Add takeViewSnapshot() for GTK.
1931         * UIProcess/ViewGestureController.cpp: Renamed from Source/WebKit/UIProcess/Cocoa/ViewGestureController.cpp.
1932         (WebKit::ViewGestureController::ViewGestureController):
1933         (WebKit::ViewGestureController::~ViewGestureController):
1934         (WebKit::ViewGestureController::disconnectFromProcess):
1935         (WebKit::ViewGestureController::connectToProcess):
1936         (WebKit::ViewGestureController::controllerForGesture):
1937         (WebKit::ViewGestureController::takeNextGestureID):
1938         (WebKit::ViewGestureController::willBeginGesture):
1939         (WebKit::ViewGestureController::didEndGesture):
1940         (WebKit::ViewGestureController::setAlternateBackForwardListSourcePage):
1941         (WebKit::ViewGestureController::canSwipeInDirection const):
1942         (WebKit::ViewGestureController::didStartProvisionalOrSameDocumentLoadForMainFrame):
1943         (WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
1944         (WebKit::ViewGestureController::didFirstVisuallyNonEmptyLayoutForMainFrame):
1945         (WebKit::ViewGestureController::didRepaintAfterNavigation):
1946         (WebKit::ViewGestureController::didHitRenderTreeSizeThreshold):
1947         (WebKit::ViewGestureController::didRestoreScrollPosition):
1948         (WebKit::ViewGestureController::didReachMainFrameLoadTerminalState):
1949         (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
1950         (WebKit::ViewGestureController::checkForActiveLoads):
1951         (WebKit::ViewGestureController::SnapshotRemovalTracker::SnapshotRemovalTracker):
1952         (WebKit::ViewGestureController::SnapshotRemovalTracker::eventsDescription):
1953         (WebKit::ViewGestureController::SnapshotRemovalTracker::log const):
1954         (WebKit::ViewGestureController::SnapshotRemovalTracker::resume):
1955         (WebKit::ViewGestureController::SnapshotRemovalTracker::start):
1956         (WebKit::ViewGestureController::SnapshotRemovalTracker::reset):
1957         (WebKit::ViewGestureController::SnapshotRemovalTracker::stopWaitingForEvent):
1958         (WebKit::ViewGestureController::SnapshotRemovalTracker::eventOccurred):
1959         (WebKit::ViewGestureController::SnapshotRemovalTracker::cancelOutstandingEvent):
1960         (WebKit::ViewGestureController::SnapshotRemovalTracker::hasOutstandingEvent):
1961         (WebKit::ViewGestureController::SnapshotRemovalTracker::fireRemovalCallbackIfPossible):
1962         (WebKit::ViewGestureController::SnapshotRemovalTracker::fireRemovalCallbackImmediately):
1963         (WebKit::ViewGestureController::SnapshotRemovalTracker::watchdogTimerFired):
1964         (WebKit::ViewGestureController::SnapshotRemovalTracker::startWatchdog):
1965         (WebKit::deltaShouldCancelSwipe):
1966         (WebKit::ViewGestureController::PendingSwipeTracker::PendingSwipeTracker):
1967         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe):
1968         (WebKit::ViewGestureController::PendingSwipeTracker::handleEvent):
1969         (WebKit::ViewGestureController::PendingSwipeTracker::eventWasNotHandledByWebCore):
1970         (WebKit::ViewGestureController::PendingSwipeTracker::tryToStartSwipe):
1971         (WebKit::ViewGestureController::PendingSwipeTracker::reset):
1972         (WebKit::ViewGestureController::startSwipeGesture):
1973         (WebKit::ViewGestureController::isPhysicallySwipingLeft const):
1974         (WebKit::ViewGestureController::shouldUseSnapshotForSize):
1975         (WebKit::ViewGestureController::forceRepaintIfNeeded):
1976         (WebKit::ViewGestureController::willEndSwipeGesture):
1977         (WebKit::ViewGestureController::endSwipeGesture):
1978         (WebKit::ViewGestureController::requestRenderTreeSizeNotificationIfNeeded):
1979         * UIProcess/ViewGestureController.h: Renamed from Source/WebKit/UIProcess/Cocoa/ViewGestureController.h.
1980         (WebKit::ViewGestureController::wheelEventWasNotHandledByWebCore):
1981         (WebKit::ViewGestureController::shouldIgnorePinnedState):
1982         (WebKit::ViewGestureController::setShouldIgnorePinnedState):
1983         (WebKit::ViewGestureController::hasActiveMagnificationGesture const):
1984         (WebKit::ViewGestureController::setCustomSwipeViews):
1985         (WebKit::ViewGestureController::setCustomSwipeViewsTopContentInset):
1986         (WebKit::ViewGestureController::setDidMoveSwipeSnapshotCallback):
1987         (WebKit::ViewGestureController::backgroundColorForCurrentSnapshot const):
1988         (WebKit::ViewGestureController::didFinishLoadForMainFrame):
1989         (WebKit::ViewGestureController::didFailLoadForMainFrame):
1990         (WebKit::ViewGestureController::setSwipeGestureEnabled):
1991         (WebKit::ViewGestureController::isSwipeGestureEnabled):
1992         (WebKit::ViewGestureController::SnapshotRemovalTracker::pause):
1993         (WebKit::ViewGestureController::SnapshotRemovalTracker::isPaused const):
1994         (WebKit::ViewGestureController::SnapshotRemovalTracker::hasRemovalCallback const):
1995         (WebKit::ViewGestureController::SnapshotRemovalTracker::renderTreeSizeThreshold const):
1996         (WebKit::ViewGestureController::SnapshotRemovalTracker::setRenderTreeSizeThreshold):
1997         (WebKit::ViewGestureController::PendingSwipeTracker::shouldIgnorePinnedState):
1998         (WebKit::ViewGestureController::PendingSwipeTracker::setShouldIgnorePinnedState):
1999         (WebKit::ViewGestureController::SwipeProgressTracker::progress const):
2000         (WebKit::ViewGestureController::SwipeProgressTracker::direction const):
2001         * UIProcess/ViewGestureController.messages.in: Renamed from Source/WebKit/UIProcess/Cocoa/ViewGestureController.messages.in.
2002         * UIProcess/ViewSnapshotStore.cpp: Copied from Source/WebKit/UIProcess/mac/ViewSnapshotStore.mm.
2003         (WebKit::ViewSnapshotStore::ViewSnapshotStore):
2004         (WebKit::ViewSnapshotStore::~ViewSnapshotStore):
2005         (WebKit::ViewSnapshotStore::singleton):
2006         (WebKit::ViewSnapshotStore::didAddImageToSnapshot):
2007         (WebKit::ViewSnapshotStore::willRemoveImageFromSnapshot):
2008         (WebKit::ViewSnapshotStore::pruneSnapshots):
2009         (WebKit::ViewSnapshotStore::recordSnapshot):
2010         (WebKit::ViewSnapshotStore::discardSnapshotImages):
2011         (WebKit::ViewSnapshot::~ViewSnapshot):
2012         * UIProcess/ViewSnapshotStore.h: Renamed from Source/WebKit/UIProcess/mac/ViewSnapshotStore.h.
2013         (WebKit::ViewSnapshot::setRenderTreeSize):
2014         (WebKit::ViewSnapshot::renderTreeSize const):
2015         (WebKit::ViewSnapshot::setBackgroundColor):
2016         (WebKit::ViewSnapshot::backgroundColor const):
2017         (WebKit::ViewSnapshot::setViewScrollPosition):
2018         (WebKit::ViewSnapshot::viewScrollPosition const):
2019         (WebKit::ViewSnapshot::setDeviceScaleFactor):
2020         (WebKit::ViewSnapshot::deviceScaleFactor const):
2021         (WebKit::ViewSnapshot::surface const):
2022         (WebKit::ViewSnapshot::imageSizeInBytes const):
2023         (WebKit::ViewSnapshot::size const):
2024         (WebKit::ViewSnapshotStore::setDisableSnapshotVolatilityForTesting):
2025         (WebKit::ViewSnapshotStore::disableSnapshotVolatilityForTesting const):
2026         * UIProcess/WebBackForwardList.cpp:
2027         (WebKit::WebBackForwardList::didRemoveItem): Unset snapshot for GTK.
2028         * UIProcess/WebMemoryPressureHandler.cpp: Copied from Source/WebKit/UIProcess/Cocoa/WebMemoryPressureHandlerCocoa.mm.
2029         (WebKit::installMemoryPressureHandler):
2030         * UIProcess/WebMemoryPressureHandler.h: Renamed from Source/WebKit/UIProcess/Cocoa/WebMemoryPressureHandlerCocoa.h.
2031         * UIProcess/WebPageProxy.cpp:
2032         (WebKit::WebPageProxy::recordNavigationSnapshot): Take snapshots for GTK.
2033         * UIProcess/WebPageProxy.h:
2034         * UIProcess/gtk/ViewGestureControllerGtk.cpp: Added. This is a port of
2035         UIProcess/mac/ViewGestureControllerMac.mm. SwipeProgressTracker class is a
2036         re-implementation of trackSwipeEventWithOptions.
2037         (WebKit::isEventStop):
2038         (WebKit::ViewGestureController::platformTeardown):
2039         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanStartSwipe):
2040         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanEndSwipe):
2041         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanInfluenceSwipe):
2042         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventGetScrollingDeltas):
2043         (WebKit::ViewGestureController::handleScrollWheelEvent):
2044         (WebKit::ViewGestureController::trackSwipeGesture):
2045         (WebKit::ViewGestureController::SwipeProgressTracker::SwipeProgressTracker):
2046         (WebKit::ViewGestureController::SwipeProgressTracker::startTracking):
2047         (WebKit::ViewGestureController::SwipeProgressTracker::reset):
2048         (WebKit::ViewGestureController::SwipeProgressTracker::handleEvent):
2049         (WebKit::ViewGestureController::SwipeProgressTracker::startAnimation):
2050         (WebKit::easeOutCubic):
2051         (WebKit::ViewGestureController::SwipeProgressTracker::onAnimationTick):
2052         (WebKit::ViewGestureController::SwipeProgressTracker::endAnimation):
2053         (WebKit::ViewGestureController::beginSwipeGesture):
2054         (WebKit::ViewGestureController::handleSwipeGesture):
2055         (WebKit::ViewGestureController::draw):
2056         (WebKit::ViewGestureController::removeSwipeSnapshot):
2057         (WebKit::ViewGestureController::beginSimulatedSwipeInDirectionForTesting):
2058         (WebKit::ViewGestureController::completeSimulatedSwipeInDirectionForTesting):
2059         * UIProcess/gtk/ViewSnapshotStoreGtk.cpp: Renamed from Source/WebKit/UIProcess/Cocoa/WebMemoryPressureHandlerCocoa.mm.
2060         (WebKit::ViewSnapshot::create):
2061         (WebKit::ViewSnapshot::ViewSnapshot):
2062         (WebKit::ViewSnapshot::hasImage const):
2063         (WebKit::ViewSnapshot::clearImage):
2064         (WebKit::ViewSnapshot::imageSizeInBytes const):
2065         (WebKit::ViewSnapshot::size const):
2066         * UIProcess/gtk/WebProcessPoolGtk.cpp:
2067         (WebKit::memoryPressureMonitorDisabled): Added.
2068         (WebKit::WebProcessPool::platformInitialize): Install memory pressure handler.
2069         (WebKit::WebProcessPool::platformInitializeWebProcess): Use memoryPressureMonitorDisabled().
2070         * UIProcess/mac/ViewGestureControllerMac.mm:
2071         Moved many functions into UIProcess/ViewGestureController.cpp
2072         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanStartSwipe):
2073         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanEndSwipe):
2074         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanInfluenceSwipe):
2075         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventGetScrollingDeltas):
2076         (WebKit::ViewGestureController::trackSwipeGesture):
2077         (WebKit::scrollEventCanInfluenceSwipe): Deleted.
2078         (WebKit::deltaShouldCancelSwipe): Deleted.
2079         (WebKit::ViewGestureController::PendingSwipeTracker::PendingSwipeTracker): Deleted.
2080         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe): Deleted.
2081         (WebKit::ViewGestureController::PendingSwipeTracker::handleEvent): Deleted.
2082         (WebKit::ViewGestureController::PendingSwipeTracker::eventWasNotHandledByWebCore): Deleted.
2083         (WebKit::ViewGestureController::PendingSwipeTracker::tryToStartSwipe): Deleted.
2084         (WebKit::ViewGestureController::PendingSwipeTracker::reset): Deleted.
2085         (WebKit::ViewGestureController::willEndSwipeGesture): Deleted.
2086         (WebKit::ViewGestureController::shouldUseSnapshotForSize): Deleted.
2087         (WebKit::ViewGestureController::isPhysicallySwipingLeft const): Deleted.
2088         (WebKit::ViewGestureController::endSwipeGesture): Deleted.
2089         (WebKit::ViewGestureController::forceRepaintIfNeeded): Deleted.
2090         (WebKit::ViewGestureController::requestRenderTreeSizeNotificationIfNeeded): Deleted.
2091         * UIProcess/mac/ViewSnapshotStoreMac.mm: Renamed from Source/WebKit/UIProcess/mac/ViewSnapshotStore.mm.
2092         (WebKit::ViewSnapshotStore::snapshottingContext):
2093         (WebKit::ViewSnapshot::create):
2094         (WebKit::ViewSnapshot::ViewSnapshot):
2095         (WebKit::ViewSnapshot::setSurface):
2096         (WebKit::ViewSnapshot::hasImage const):
2097         (WebKit::ViewSnapshot::clearImage):
2098         (WebKit::ViewSnapshot::setVolatile):
2099         (WebKit::ViewSnapshot::asLayerContents):
2100         (WebKit::ViewSnapshot::asImageForTesting):
2101         * WebKit.xcodeproj/project.pbxproj:
2102         * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
2103         Make SetRenderTreeSizeNotificationThreshold() cross-platform.
2104         (WebKit::ViewGestureGeometryCollector::ViewGestureGeometryCollector):
2105         (WebKit::ViewGestureGeometryCollector::computeMinimumAndMaximumViewportScales const):
2106         (WebKit::ViewGestureGeometryCollector::mainFrameDidLayout):
2107         * WebProcess/WebPage/ViewGestureGeometryCollector.h:
2108         * WebProcess/WebPage/ViewGestureGeometryCollector.messages.in:
2109         * WebProcess/WebPage/WebPage.cpp:
2110         Start using ViewGestureGeometryCollector for GTK.
2111         (WebKit::WebPage::mainFrameDidLayout):
2112         * WebProcess/WebPage/WebPage.h:
2113
2114 2019-02-08  Alex Christensen  <achristensen@webkit.org>
2115
2116         Add SPI to use networking daemon instead of XPC service
2117         https://bugs.webkit.org/show_bug.cgi?id=194427
2118
2119         Reviewed by Geoffrey Garen.
2120
2121         There is still work to be done, but with the proper plist it starts and loads webpages!
2122
2123         * NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm:
2124         (WebKit::DaemonMain):
2125         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
2126         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
2127         (WebKit::XPCEventHandler):
2128         (WebKit::XPCInitializationHandler):
2129         (WebKit::XPCServiceMain):
2130         (WebKit::XPCServiceEventHandler): Deleted.
2131         * UIProcess/API/APIProcessPoolConfiguration.h:
2132         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2133         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
2134         (-[_WKProcessPoolConfiguration usesNetworkingDaemon]):
2135         (-[_WKProcessPoolConfiguration setUsesNetworkingDaemon:]):
2136         * UIProcess/AuxiliaryProcessProxy.cpp:
2137         (WebKit::AuxiliaryProcessProxy::getLaunchOptions):
2138         * UIProcess/Launcher/ProcessLauncher.h:
2139         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2140         (WebKit::serviceName):
2141         (WebKit::ProcessLauncher::launchProcess):
2142         * UIProcess/Network/NetworkProcessProxy.cpp:
2143         (WebKit::NetworkProcessProxy::getLaunchOptions):
2144         * UIProcess/WebProcessPool.cpp:
2145         (WebKit::WebProcessPool::usesNetworkingDaemon const):
2146         * UIProcess/WebProcessPool.h:
2147
2148 2019-02-08  Truitt Savell  <tsavell@apple.com>
2149
2150         Unreviewed, rolling out r241197.
2151
2152         Broke iOS Simulator Debug build and casued 1 API failure on
2153         High Sierra
2154
2155         Reverted changeset:
2156
2157         "Add SPI to use networking daemon instead of XPC service"
2158         https://bugs.webkit.org/show_bug.cgi?id=194427
2159         https://trac.webkit.org/changeset/241197
2160
2161 2019-02-08  Beth Dakin  <bdakin@apple.com>
2162
2163         Abstract and discussion comments needed for afterScreenUpdates
2164         https://bugs.webkit.org/show_bug.cgi?id=194442
2165
2166         Reviewed by Wenson Hsieh.
2167
2168         Forgot to add these comments with https://bugs.webkit.org/show_bug.cgi?id=194362
2169         * UIProcess/API/Cocoa/WKSnapshotConfiguration.h:
2170
2171 2019-02-08  Beth Dakin  <bdakin@apple.com>
2172
2173         Add afterScreenUpdates to WKSnapshotConfiguration
2174         https://bugs.webkit.org/show_bug.cgi?id=194362
2175         -and corresponding-
2176         <rdar://problem/40655528> Please add an "after screen updates" property to 
2177         WKSnapshotConfiguration (to solve blank snapshots)
2178
2179         Reviewed by Tim Horton.
2180
2181         This is the WebKit equivalent of - (UIView *)snapshotViewAfterScreenUpdates:(BOOL)afterUpdates;
2182         This makes our snapshotting API more predictable and reliable on iOS devices, 
2183         which is why the new configuration property defaults to YES.
2184
2185         New property that defaults to YES.
2186         * UIProcess/API/Cocoa/WKSnapshotConfiguration.h:
2187         * UIProcess/API/Cocoa/WKSnapshotConfiguration.mm:
2188         (-[WKSnapshotConfiguration init]):
2189         (-[WKSnapshotConfiguration copyWithZone:]):
2190
2191         When afterScreenUpdates is set, invoke the snapshot via 
2192         callAfterNextPresentationUpdate.
2193         * UIProcess/API/Cocoa/WKWebView.mm:
2194         (-[WKWebView takeSnapshotWithConfiguration:completionHandler:]):
2195         (-[WKWebView _callCompletionHandler:withSnapshotImage:atDeviceScale:]):
2196
2197 2019-02-08  Alex Christensen  <achristensen@webkit.org>
2198
2199         Add SPI to use networking daemon instead of XPC service
2200         https://bugs.webkit.org/show_bug.cgi?id=194427
2201
2202         Reviewed by Geoffrey Garen.
2203
2204         There is still work to be done, but with the proper plist it starts and loads webpages!
2205
2206         * NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm:
2207         (WebKit::DaemonMain):
2208         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
2209         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
2210         (WebKit::XPCEventHandler):
2211         (WebKit::XPCInitializationHandler):
2212         (WebKit::XPCServiceMain):
2213         (WebKit::XPCServiceEventHandler): Deleted.
2214         * UIProcess/API/APIProcessPoolConfiguration.h:
2215         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2216         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
2217         (-[_WKProcessPoolConfiguration usesNetworkingDaemon]):
2218         (-[_WKProcessPoolConfiguration setUsesNetworkingDaemon:]):
2219         * UIProcess/AuxiliaryProcessProxy.cpp:
2220         (WebKit::AuxiliaryProcessProxy::getLaunchOptions):
2221         * UIProcess/Launcher/ProcessLauncher.h:
2222         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2223         (WebKit::serviceName):
2224         (WebKit::ProcessLauncher::launchProcess):
2225         * UIProcess/Network/NetworkProcessProxy.cpp:
2226         (WebKit::NetworkProcessProxy::getLaunchOptions):
2227         * UIProcess/WebProcessPool.cpp:
2228         (WebKit::WebProcessPool::usesNetworkingDaemon const):
2229         * UIProcess/WebProcessPool.h:
2230
2231 2019-02-08  Keith Rollin  <krollin@apple.com>
2232
2233         Unreviewed build fix.
2234
2235         r241135 modified how entitlements were built up for the macOS. Those
2236         changes broke the iOSMac builds. Bring back some deletions in order to
2237         fix iOSMac.
2238
2239         * Configurations/PluginService.64.xcconfig:
2240         * Configurations/PluginService.entitlements: Added.
2241         * WebKit.xcodeproj/project.pbxproj:
2242
2243 2019-02-07  Chris Dumez  <cdumez@apple.com>
2244
2245         Mark more heap-allocated classes as fast allocated
2246         https://bugs.webkit.org/show_bug.cgi?id=194422
2247
2248         Reviewed by Ryosuke Niwa.
2249
2250         * NetworkProcess/NetworkLoad.cpp:
2251         * NetworkProcess/NetworkLoadChecker.h:
2252         * NetworkProcess/NetworkResourceLoader.cpp:
2253         * Platform/IPC/Connection.h:
2254         * Platform/IPC/mac/ImportanceAssertion.h:
2255         * PluginProcess/PluginCreationParameters.h:
2256         * Shared/API/Cocoa/RemoteObjectRegistry.h:
2257         * Shared/WebEvent.h:
2258         * UIProcess/API/APIHTTPCookieStore.cpp:
2259         * UIProcess/API/APINotificationProvider.h:
2260         * UIProcess/API/Cocoa/PageLoadStateObserver.h:
2261         * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
2262         * UIProcess/API/Cocoa/WKWebView.mm:
2263         (-[WKWebView _setInputDelegate:]):
2264         * UIProcess/API/gtk/PageClientImpl.h:
2265         * UIProcess/BackingStore.h:
2266         * UIProcess/Cocoa/AutomationClient.h:
2267         * UIProcess/Cocoa/DiagnosticLoggingClient.h:
2268         * UIProcess/Cocoa/DownloadClient.h:
2269         * UIProcess/Cocoa/FindClient.h:
2270         * UIProcess/Cocoa/NavigationState.h:
2271         * UIProcess/Cocoa/UIDelegate.h:
2272         * UIProcess/Cocoa/ViewGestureController.h:
2273         * UIProcess/DeviceIdHashSaltStorage.h:
2274         * UIProcess/Downloads/DownloadProxyMap.h:
2275         * UIProcess/Gamepad/UIGamepad.h:
2276         * UIProcess/Notifications/WebNotificationProvider.h:
2277         * UIProcess/ProcessAssertion.h:
2278         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h:
2279         * UIProcess/WebContextInjectedBundleClient.h:
2280         * UIProcess/WebFormClient.h:
2281         * UIProcess/WebGeolocationProvider.h:
2282         * UIProcess/WebPageProxy.h:
2283         * WebProcess/Automation/WebAutomationSessionProxy.h:
2284         * WebProcess/InjectedBundle/API/APIInjectedBundleBundleClient.h:
2285         * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h:
2286         * WebProcess/InjectedBundle/API/APIInjectedBundlePageContextMenuClient.h:
2287         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
2288         * WebProcess/InjectedBundle/API/APIInjectedBundlePageResourceLoadClient.h:
2289         * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
2290         * WebProcess/InjectedBundle/APIInjectedBundleFormClient.h:
2291         * WebProcess/Network/webrtc/LibWebRTCNetwork.h:
2292         * WebProcess/Network/webrtc/LibWebRTCSocket.h:
2293         * WebProcess/Network/webrtc/WebRTCResolver.h:
2294         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
2295         * WebProcess/WebPage/DrawingArea.h:
2296
2297 2019-02-07  Wenson Hsieh  <wenson_hsieh@apple.com>
2298
2299         [iOS] [WK2] Modernize code for applying autocorrection
2300         https://bugs.webkit.org/show_bug.cgi?id=194397
2301
2302         Reviewed by Tim Horton.
2303
2304         * UIProcess/ios/WKContentViewInteraction.h:
2305         * UIProcess/ios/WKContentViewInteraction.mm:
2306         (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
2307         (-[WKContentView applyAutocorrection:toString:withCompletionHandler:]):
2308
2309         Use BlockPtr instead of temporarily storing the completion handler.
2310
2311         * WebProcess/WebPage/WebPage.h:
2312         * WebProcess/WebPage/WebPage.messages.in:
2313
2314         Change a LegacySync to Delayed.
2315
2316         * WebProcess/WebPage/ios/WebPageIOS.mm:
2317         (WebKit::WebPage::applyAutocorrection):
2318         (WebKit::WebPage::syncApplyAutocorrection):
2319         (WebKit::WebPage::applyAutocorrectionInternal):
2320
2321 2019-02-07  Wenson Hsieh  <wenson_hsieh@apple.com>
2322
2323         [iOS] Clicking links in Safari using Apple Pencil is much more difficult after r238475
2324         https://bugs.webkit.org/show_bug.cgi?id=194415
2325         <rdar://problem/47550281>
2326
2327         Reviewed by Tim Horton.
2328
2329         Fix the bug by not firing the Apple-pencil-exclusive tap gesture recognizer in the case where editable images
2330         are disabled. This gesture recognizer is only used for inserting editable images, and currently conflicts with
2331         the synthetic click gesture recognizer used to recognize clicks from generic digitizer inputs.
2332
2333         * UIProcess/ios/WKContentViewInteraction.mm:
2334         (-[WKContentView gestureRecognizerShouldBegin:]):
2335         (-[WKContentView _stylusSingleTapRecognized:]):
2336
2337 2019-02-07  Per Arne Vollan  <pvollan@apple.com>
2338
2339         [macOS] Block coreservicesd in sandbox.
2340         https://bugs.webkit.org/show_bug.cgi?id=192670
2341
2342         Reviewed by Alexey Proskuryakov.
2343
2344         We should block CoreServices in newer versions of macOS. In order to achieve this we need to avoid calling
2345         _RegisterApplication before entering the sandbox, since this call will open up a connection to CoreServices.
2346         The call to _RegisterApplication is moved to ChildProcess::updateProcessName, since it is needed to
2347         successfully update the process name. The call to ChildProcess::updateProcessName is made after entering
2348         the sandbox.
2349
2350         * Shared/AuxiliaryProcess.cpp:
2351         (WebKit::AuxiliaryProcess::initialize):
2352         * WebProcess/cocoa/WebProcessCocoa.mm:
2353         (WebKit::WebProcess::initializeProcessName):
2354         (WebKit::WebProcess::platformInitializeProcess):
2355         * WebProcess/com.apple.WebProcess.sb.in:
2356
2357 2019-02-07  Youenn Fablet  <youenn@apple.com>
2358
2359         Filter out Overconstrainederror.constraint when getUserMedia is not granted
2360         https://bugs.webkit.org/show_bug.cgi?id=194240
2361
2362         Reviewed by Eric Carlson.
2363
2364         Make sure in UIProcess to filter out constraint if either the page was not granted gum access or it has no persistent access.
2365
2366         Refactor UserMediaPermissionRequestManagerProxy to make the implementation easier to understand.
2367
2368         Covered by added test.
2369
2370         * UIProcess/UserMediaPermissionCheckProxy.cpp:
2371         (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo):
2372         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2373         (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
2374         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
2375         (WebKit::UserMediaPermissionRequestManagerProxy::grantAccess):
2376         (WebKit::UserMediaPermissionRequestManagerProxy::getRequestAction):
2377         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
2378         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionRequest):
2379         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionInvalidRequest):
2380         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionValidRequest):
2381         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
2382         (WebKit::UserMediaPermissionRequestManagerProxy::wasGrantedVideoOrAudioAccess):
2383         (WebKit::UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList):
2384         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
2385         (WebKit::UserMediaPermissionRequestManagerProxy::createPermissionRequest): Deleted.
2386         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2387         * UIProcess/UserMediaPermissionRequestProxy.h:
2388         (WebKit::UserMediaPermissionRequestProxy::isPending const):
2389         (WebKit::UserMediaPermissionRequestProxy::setEligibleVideoDeviceUIDs):
2390         (WebKit::UserMediaPermissionRequestProxy::setEligibleAudioDeviceUIDs):
2391         (WebKit::UserMediaPermissionRequestProxy::hasAudioDevice const):
2392         (WebKit::UserMediaPermissionRequestProxy::hasVideoDevice const):
2393         (WebKit::UserMediaPermissionRequestProxy::hasPersistentAccess const):
2394         (WebKit::UserMediaPermissionRequestProxy::setHasPersistentAccess):
2395         (WebKit::UserMediaPermissionRequestProxy::userMediaID const):
2396         (WebKit::UserMediaPermissionRequestProxy::topLevelDocumentSecurityOrigin const):
2397         (WebKit::UserMediaPermissionRequestProxy::userMediaDocumentSecurityOrigin const):
2398         (WebKit::UserMediaPermissionRequestProxy::userRequest const):
2399         (WebKit::UserMediaPermissionRequestProxy::setDeviceIdentifierHashSalt):
2400         (WebKit::UserMediaPermissionRequestProxy::deviceIdentifierHashSalt const):
2401         (WebKit::UserMediaPermissionRequestProxy::audioDevice const):
2402         (WebKit::UserMediaPermissionRequestProxy::videoDevice const):
2403         * UIProcess/WebPageProxy.cpp:
2404         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
2405         * UIProcess/WebPageProxy.h:
2406
2407 2019-02-07  Wenson Hsieh  <wenson_hsieh@apple.com>
2408
2409         [iOS] [WK2] Modernize autocorrection context code
2410         https://bugs.webkit.org/show_bug.cgi?id=194373
2411
2412         Reviewed by Tim Horton.
2413
2414         * Shared/ios/WebAutocorrectionContext.h: Added.
2415         (WebKit::WebAutocorrectionContext::encode const):
2416         (WebKit::WebAutocorrectionContext::decode):
2417
2418         Introduce a WebAutocorrectionContext struct that encapsulates the individual pieces of autocorrection context.
2419         Change to use this instead of a long list of arguments when propagating autocorrection context information over
2420         IPC.
2421
2422         * UIProcess/AutoCorrectionCallback.h:
2423         * UIProcess/WebPageProxy.h:
2424         * UIProcess/WebPageProxy.messages.in:
2425         * UIProcess/ios/WKContentViewInteraction.h:
2426         * UIProcess/ios/WKContentViewInteraction.mm:
2427         (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
2428         (+[WKAutocorrectionContext autocorrectionContextWithContext:]):
2429         (+[WKAutocorrectionContext autocorrectionContextWithData:markedText:selectedText:afterText:selectedRangeInMarkedText:]): Deleted.
2430
2431         Change this constructor to take an entire WebAutocorrectionContext.
2432
2433         * UIProcess/ios/WebPageProxyIOS.mm:
2434         (WebKit::WebPageProxy::autocorrectionContextCallback):
2435         (WebKit::WebPageProxy::requestAutocorrectionContext):
2436         (WebKit::WebPageProxy::autocorrectionContextSync):
2437         (WebKit::WebPageProxy::getAutocorrectionContext): Deleted.
2438         * WebKit.xcodeproj/project.pbxproj:
2439         * WebProcess/WebPage/WebPage.h:
2440         * WebProcess/WebPage/WebPage.messages.in:
2441
2442         Use Delayed instead of LegacySync.
2443
2444         * WebProcess/WebPage/ios/WebPageIOS.mm:
2445         (WebKit::WebPage::autocorrectionContext):
2446
2447         Renamed from computeAutocorrectionContext. This is now a private method on WebPage that uses the focused or main
2448         frame to compute and return a WebAutocorrectionContext.
2449
2450         (WebKit::WebPage::requestAutocorrectionContext):
2451         (WebKit::WebPage::autocorrectionContextSync):
2452
2453         Renamed getAutocorrectionContext to autocorrectionContextSync.
2454
2455         (WebKit::computeAutocorrectionContext): Deleted.
2456         (WebKit::WebPage::getAutocorrectionContext): Deleted.
2457
2458 2019-02-07  Youenn Fablet  <youenn@apple.com>
2459
2460         Simplify applyConstraints callbacks
2461         https://bugs.webkit.org/show_bug.cgi?id=194297
2462
2463         Reviewed by Eric Carlson.
2464
2465         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
2466         (WebKit::UserMediaCaptureManagerProxy::applyConstraints):
2467         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
2468         (WebKit::UserMediaCaptureManager::Source::applyConstraintsSucceeded):
2469         (WebKit::UserMediaCaptureManager::Source::applyConstraintsFailed):
2470         (WebKit::UserMediaCaptureManager::applyConstraintsFailed):
2471         * WebProcess/cocoa/UserMediaCaptureManager.h:
2472
2473 2019-02-07  Brent Fulgham  <bfulgham@apple.com>
2474
2475         Permit additional IOKit Properties needed by Media PlugIns on older Mac Hardware
2476         https://bugs.webkit.org/show_bug.cgi?id=194412
2477         <rdar://problem/47820615>
2478
2479         Reviewed by Per Arne Vollan.
2480
2481         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
2482
2483 2019-02-07  Brent Fulgham  <bfulgham@apple.com>
2484
2485         Permit additional IOKit Properties needed by older Mac Hardware
2486         https://bugs.webkit.org/show_bug.cgi?id=194410
2487         <rdar://problem/47820620>
2488
2489         Reviewed by Per Arne Vollan.
2490
2491         * WebProcess/com.apple.WebProcess.sb.in:
2492
2493 2019-02-07  Brady Eidson  <beidson@apple.com>
2494
2495         Rename the TAKE_DOWNLOAD_ASSERTION macro.
2496
2497         Rubberstamped by Andy Estes.
2498
2499         * NetworkProcess/Downloads/DownloadMap.cpp:
2500         * NetworkProcess/Downloads/DownloadMap.h:
2501
2502 2019-02-07  Keith Rollin  <krollin@apple.com>
2503
2504         Fix XCBuild issue related to codesigning WebContent process
2505         https://bugs.webkit.org/show_bug.cgi?id=193799
2506         <rdar://problem/47533890>
2507
2508         Reviewed by Brent Fulgham.
2509
2510         Building with XCBuild enabled results in the error message "cannot
2511         read entitlement data" when trying to codesign the macOS XPC
2512         processes. The reason for this error message is that there is a build
2513         step that deletes any previous "stale" generated .xcent file before
2514         building up a new one. With XCBuild enabled, the build steps got
2515         re-ordered, such that the step that deletes this file could get
2516         executed after the steps that build up the file. The built-up set of
2517         entitlements is now gone, and the build process fails when `codesign`
2518         tries to access it.
2519
2520         The apparent quick-fix to this problem -- of tweaking dependencies so
2521         that the build steps execute in the desired order -- wouldn't work
2522         with XCBuild. Establishing these dependencies would require both
2523         having multiple build phases produce the same .xcent file as output,
2524         as well as a build phase that has this file as an input and an output.
2525         XCBuild either forbids or frowns upon these configurations.
2526
2527         Ultimately, the solution that worked was to take over complete control
2528         of the codesigning process. This means (a) not specifying a base
2529         .entitlements file that XCode uses to start with (and which was
2530         subsequently altered via custom build scripts), (b) not letting XCode
2531         automatically and silently inject a 'get-task-all' entitlement used to
2532         facilitate debugging (we now add that entitlement by hand), and (c)
2533         building up all of our entitlements by hand via a single custom
2534         script. Because of the addition of this custom script, many other
2535         scripts and entitlements files could now be removed.
2536
2537         * Configurations/BaseXPCService.xcconfig:
2538         * Configurations/Databases-iOS.entitlements: Removed.
2539         * Configurations/Network-OSX-restricted.entitlements: Removed.
2540         * Configurations/Network-OSX-sandbox.entitlements: Removed.
2541         * Configurations/Network-OSX.entitlements: Removed.
2542         * Configurations/NetworkService.xcconfig:
2543         * Configurations/PluginService.64.xcconfig:
2544         * Configurations/PluginService.entitlements: Removed.
2545         * Configurations/WebContent-OSX-sandbox.entitlements: Removed.
2546         * Configurations/WebContent-OSX.entitlements: Removed.
2547         * Configurations/WebContent-or-Plugin-OSX-restricted.entitlements: Removed.
2548         * Configurations/WebContentService.xcconfig:
2549         * Scripts/copy-webcontent-resources-to-private-headers.sh:
2550         * Scripts/process-entitlements.sh: Added.
2551         * Scripts/process-network-sandbox-entitlements.sh: Removed.
2552         * Scripts/process-webcontent-or-plugin-entitlements.sh: Removed.
2553         * Scripts/process-webcontent-sandbox-entitlements.sh: Removed.
2554         * WebKit.xcodeproj/project.pbxproj:
2555
2556 2019-02-07  Alex Christensen  <achristensen@webkit.org>
2557
2558         Fix internal build after r241127
2559         https://bugs.webkit.org/show_bug.cgi?id=191394
2560
2561         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
2562         Add some (un)availability macros.
2563
2564 2019-02-07  Youenn Fablet  <youenn@apple.com>
2565
2566         Make to clear sources from UserMediaCaptureManagerProxy and UserMediaCaptureManager when no longer needed
2567         https://bugs.webkit.org/show_bug.cgi?id=194312
2568
2569         Reviewed by Eric Carlson.
2570
2571         Sources in UserMediaCaptureManager and Proxy are never removed once added to their HashMap.
2572         Use the 'ended' mechanism to do the clean-up on WebProcess side.
2573         As part of this clean-up, send IPC to UIProcess to do clean-up on proxy side.
2574         On WebProcess crash case, clean-up the proxy as well.
2575
2576         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
2577         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
2578         (WebKit::UserMediaCaptureManagerProxy::end):
2579         (WebKit::UserMediaCaptureManagerProxy::clear):
2580         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
2581         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
2582         * UIProcess/WebProcessProxy.cpp:
2583         (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
2584         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
2585         (WebKit::UserMediaCaptureManager::sourceEnded):
2586         * WebProcess/cocoa/UserMediaCaptureManager.h:
2587
2588 2019-02-07  Alex Christensen  <achristensen@webkit.org>
2589
2590         Print backgrounds preference should be honored instead of WKWebViewConfiguration value
2591         https://bugs.webkit.org/show_bug.cgi?id=194364
2592         <rdar://problem/47627599>
2593
2594         Reviewed by Tim Horton.
2595
2596         Without this patch, changing the preference for printing the background has no effect.
2597         This patch fixes that, and I verified it manually by checking "Print backgrounds" in Safari's print menu.
2598         Unfortunately, the only way to test this is actually printing because only values from WebPageProxy::preferences
2599         or WebPageProxy::configuration's preferences are exposed to the API, but values from WebPageProxy::preferencesStore
2600         are used when printing.  Actually printing verifies this change fixes the bug.
2601
2602         * UIProcess/API/Cocoa/WKWebView.mm:
2603         (-[WKWebView _initializeWithConfiguration:]):
2604
2605 2019-02-07  Chris Dumez  <cdumez@apple.com>
2606
2607         Mark DisplayLink as fast allocated
2608         https://bugs.webkit.org/show_bug.cgi?id=194400
2609
2610         Reviewed by Geoffrey Garen.
2611
2612         * UIProcess/mac/DisplayLink.h:
2613
2614 2019-02-07  Per Arne Vollan  <pvollan@apple.com>
2615
2616         [macOS] API test times out after r241026
2617         https://bugs.webkit.org/show_bug.cgi?id=194372
2618
2619         Reviewed by Alex Christensen.
2620
2621         The API test TestWebKitAPI.RenderingProgress.FirstMeaningfulPaint times out after r241026.
2622         A new function pointer, layoutMilestones, is added to WKBundlePageLoaderClient, in order
2623         for clients to decide which milestones they would like to listen for.
2624
2625         * WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h:
2626         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2627         (layoutMilestones):
2628         (setUpPageLoaderClient):
2629         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
2630         (WebKit::InjectedBundlePageLoaderClient::layoutMilestones const):
2631         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
2632
2633 2019-02-07  Alex Christensen  <achristensen@webkit.org>
2634
2635         Deprecate WKBundlePageSetDefersLoading
2636         https://bugs.webkit.org/show_bug.cgi?id=191394
2637
2638         Reviewed by Dean Jackson.
2639
2640         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2641         (WKBundlePageSetDefersLoading):
2642         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
2643         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2644         (-[WKWebProcessPlugInBrowserContextController _defersLoading]):
2645         (-[WKWebProcessPlugInBrowserContextController _setDefersLoading:]):
2646         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
2647
2648 2019-02-07  Alex Christensen  <achristensen@webkit.org>
2649
2650         Digital crown should scroll safe browsing warning on watchOS
2651         https://bugs.webkit.org/show_bug.cgi?id=194363
2652         <rdar://problem/47348124>
2653
2654         Reviewed by Wenson Hsieh.
2655
2656         * UIProcess/Cocoa/WKSafeBrowsingWarning.h:
2657         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
2658         (-[WKSafeBrowsingWarning initWithFrame:safeBrowsingWarning:completionHandler:]):
2659         (-[WKSafeBrowsingWarning addContent]):
2660
2661 2019-02-07  Alex Christensen  <achristensen@webkit.org>
2662
2663         Shrink and hyphenate safe browsing warning text on watchOS
2664         https://bugs.webkit.org/show_bug.cgi?id=194361
2665         <rdar://problem/47466549>
2666
2667         Reviewed by Geoffrey Garen.
2668
2669         Some internationalizations use long words that didn't fit on small watches.
2670
2671         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
2672         (fontOfSize):
2673         (-[WKSafeBrowsingWarning addContent]):
2674         (-[WKSafeBrowsingTextView initWithAttributedString:forWarning:]):
2675
2676 2019-02-07  Miguel Gomez  <magomez@igalia.com>
2677
2678         [WPE] Implement GStreamer based holepunch
2679         https://bugs.webkit.org/show_bug.cgi?id=193715
2680
2681         Reviewed by Xabier Rodriguez-Calvar.
2682
2683         Add a new parameter to the calls of TextureMapper::drawSolidColor().
2684
2685         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
2686         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
2687
2688 2019-02-06  Benjamin Poulain  <benjamin@webkit.org>
2689
2690         Unreviewed, rolling out r240759 and r240944.
2691
2692         Some timer uses are done off the main thread, WebCore::Timer
2693         cannot be used
2694
2695         Reverted changesets:
2696
2697         "<rdar://problem/47570443> Responsiveness timers are too
2698         expensive for frequent events"
2699         https://bugs.webkit.org/show_bug.cgi?id=194003
2700         https://trac.webkit.org/changeset/240759
2701
2702         "Use deferrable timer to restart the Responsiveness Timer on
2703         each wheel event"
2704         https://bugs.webkit.org/show_bug.cgi?id=194135
2705         https://trac.webkit.org/changeset/240944
2706
2707 2019-02-06  chris fleizach  <cfleizach@apple.com>
2708
2709         AX:  com.apple.WebKit.WebContent at WebKit: -[WKAccessibilityWebPageObjectBase axObjectCache]
2710         https://bugs.webkit.org/show_bug.cgi?id=194306
2711         <rdar://problem/47764549>
2712
2713         Reviewed by Zalan Bujtas.
2714
2715         Check the page reference is still valid.
2716         Modernize code in this area.
2717
2718         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
2719
2720 2019-02-06  Daniel Bates  <dabates@apple.com>
2721
2722         Move toNSEventModifierFlags() and toNSButtonNumber() to WebEventFactory.mm
2723         https://bugs.webkit.org/show_bug.cgi?id=194321
2724
2725         Reviewed by Jer Noble.
2726
2727         Move some code to WebEventFactory so that it can be shared by both WKNavigationAction.mm
2728         and UIDelegate.mm among other benefits.
2729
2730         * Shared/mac/WebEventFactory.h:
2731         * Shared/mac/WebEventFactory.mm:
2732         (WebKit::WebEventFactory::toNSEventModifierFlags):
2733         (WebKit::WebEventFactory::toNSButtonNumber):
2734         * UIProcess/API/Cocoa/WKNavigationAction.mm:
2735         (-[WKNavigationAction modifierFlags]):
2736         (-[WKNavigationAction buttonNumber]):
2737         (toNSEventModifierFlags): Deleted.
2738         (toNSButtonNumber): Deleted.
2739         * UIProcess/Cocoa/UIDelegate.mm:
2740         (WebKit::UIDelegate::UIClient::mouseDidMoveOverElement):
2741         (WebKit::toNSEventModifierFlags): Deleted.
2742
2743 2019-02-06  Andy Estes  <aestes@apple.com>
2744
2745         [Payment Request] It should be possible to require a phonetic name for shipping contacts
2746         https://bugs.webkit.org/show_bug.cgi?id=194311
2747         <rdar://46733045>
2748
2749         Reviewed by Alex Christensen.
2750
2751         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
2752         (WebKit::WebPaymentCoordinator::supportsVersion): Deleted.
2753         * WebProcess/ApplePay/WebPaymentCoordinator.h:
2754
2755 2019-02-06  Keith Rollin  <krollin@apple.com>
2756
2757         Really enable the automatic checking and regenerations of .xcfilelists during builds
2758         https://bugs.webkit.org/show_bug.cgi?id=194357
2759         <rdar://problem/47861231>
2760
2761         Reviewed by Chris Dumez.
2762
2763         Bug 194124 was supposed to enable the automatic checking and
2764         regenerating of .xcfilelist files during the build. While related
2765         changes were included in that patch, the change to actually enable the
2766         operation somehow was omitted. This patch actually enables the
2767         operation. The check-xcfilelist.sh scripts now check
2768         WK_DISABLE_CHECK_XCFILELISTS, and if it's "1", opts-out the developer
2769         from the checking.
2770
2771         * Scripts/check-xcfilelists.sh:
2772
2773 2019-02-06  John Wilander  <wilander@apple.com>
2774
2775         Forward Ad Click Attribution data from HTMLAnchorElement::handleClick() to WebKit::NavigationActionData
2776         https://bugs.webkit.org/show_bug.cgi?id=194325
2777         <rdar://problem/47840283>
2778
2779         Reviewed by Chris Dumez.
2780
2781         * Shared/NavigationActionData.cpp:
2782         (WebKit::NavigationActionData::encode const):
2783         (WebKit::NavigationActionData::decode):
2784         * Shared/NavigationActionData.h:
2785             Now holds an optional WebCore::AdClickAttribution object.
2786
2787 2019-02-06  Daniel Bates  <dabates@apple.com>
2788
2789         Fix the Apple Internal build. See <rdar://problem/47860943> for more details.
2790
2791         * UIProcess/ios/fullscreen/WKFullscreenStackView.mm:
2792         (-[WKFullscreenStackView init]):
2793
2794 2019-02-06  Daniel Bates  <dabates@apple.com>
2795
2796         Standardize on ControlKey instead of CtrlKey
2797         https://bugs.webkit.org/show_bug.cgi?id=194317
2798
2799         Reviewed by Tim Horton.
2800
2801         * Shared/WebEventConversion.cpp:
2802         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
2803         (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):
2804         (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
2805         (WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent):
2806         (WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent):
2807         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
2808         (WebKit::WebEditorClient::handleKeyboardEvent):
2809         * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
2810         (WebKit::handleKeyPress):
2811
2812 2019-02-06  Per Arne Vollan  <pvollan@apple.com>
2813
2814         Roll out parts of r238819 since it is a PLT performance regression.
2815         https://bugs.webkit.org/show_bug.cgi?id=194346
2816
2817         Unreviewed performance fix.
2818
2819         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2820         (didStartProvisionalLoadForFrame):
2821         (didReceiveServerRedirectForProvisionalLoadForFrame):
2822         (didFinishLoadForFrame):
2823         (globalObjectIsAvailableForFrame):
2824         (didRemoveFrameFromHierarchy):
2825         (didCommitLoadForFrame):
2826         (didFinishDocumentLoadForFrame):
2827         (didFailProvisionalLoadWithErrorForFrame):
2828         (didFailLoadWithErrorForFrame):
2829         (didSameDocumentNavigationForFrame):
2830         (didLayoutForFrame):
2831         (didReachLayoutMilestone):
2832         (didFirstVisuallyNonEmptyLayoutForFrame):
2833         (didHandleOnloadEventsForFrame):
2834         (userAgentForURL):
2835         (setUpPageLoaderClient):
2836         (willSendRequestForFrame):
2837         (didInitiateLoadForResource):
2838         (didFinishLoadForResource):
2839         (didFailLoadForResource):
2840         (setUpResourceLoadClient):
2841         (-[WKWebProcessPlugInBrowserContextController setLoadDelegate:]):
2842         (ResourceLoadClient::ResourceLoadClient): Deleted.
2843         (ResourceLoadClient::loadDelegate const): Deleted.
2844         (ResourceLoadClient::pluginContextController const): Deleted.
2845         (PageLoaderClient::PageLoaderClient): Deleted.
2846         (PageLoaderClient::loadDelegate const): Deleted.
2847         (PageLoaderClient::pluginContextController const): Deleted.
2848         (PageLoaderClient::didStartProvisionalLoadForFrame): Deleted.
2849         (PageLoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame): Deleted.
2850         (PageLoaderClient::didFinishLoadForFrame): Deleted.
2851         (PageLoaderClient::globalObjectIsAvailableForFrame): Deleted.
2852         (PageLoaderClient::didRemoveFrameFromHierarchy): Deleted.
2853         (PageLoaderClient::didCommitLoadForFrame): Deleted.
2854         (PageLoaderClient::didFinishDocumentLoadForFrame): Deleted.
2855         (PageLoaderClient::didFailProvisionalLoadWithErrorForFrame): Deleted.
2856         (PageLoaderClient::didFailLoadWithErrorForFrame): Deleted.
2857         (PageLoaderClient::didSameDocumentNavigationForFrame): Deleted.
2858         (PageLoaderClient::didLayoutForFrame): Deleted.
2859         (PageLoaderClient::didReachLayoutMilestone): Deleted.
2860         (PageLoaderClient::didFirstVisuallyNonEmptyLayoutForFrame): Deleted.
2861         (PageLoaderClient::layoutMilestones const): Deleted.
2862         (PageLoaderClient::didHandleOnloadEventsForFrame): Deleted.
2863         (PageLoaderClient::userAgentForURL const): Deleted.
2864         (ResourceLoadClient::willSendRequestForFrame): Deleted.
2865         (ResourceLoadClient::didInitiateLoadForResource): Deleted.
2866         (ResourceLoadClient::didFinishLoadForResource): Deleted.
2867         (ResourceLoadClient::didFailLoadForResource): Deleted.
2868
2869 2019-02-06  Michael Catanzaro  <mcatanzaro@igalia.com>
2870
2871         REGRESSION(r240785): [SOUP] Broke cookie persistent storage
2872         https://bugs.webkit.org/show_bug.cgi?id=194209
2873
2874         Reviewed by Carlos Garcia Campos.
2875
2876         I missed a spot when moving the persistent storage parameters from NetworkProcess to
2877         NetworkSession. They have to be initialized separately for the default session.
2878
2879         * UIProcess/soup/WebProcessPoolSoup.cpp:
2880         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2881
2882 2019-02-05  Alex Christensen  <achristensen@webkit.org>
2883
2884         Stop using blobRegistry in NetworkProcess
2885         https://bugs.webkit.org/show_bug.cgi?id=194027
2886
2887         Reviewed by Youenn Fablet.
2888
2889         * NetworkProcess/Downloads/DownloadManager.cpp:
2890         (WebKit::DownloadManager::startDownload):
2891         * NetworkProcess/Downloads/PendingDownload.cpp:
2892         (WebKit::PendingDownload::PendingDownload):
2893         * NetworkProcess/Downloads/PendingDownload.h:
2894         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
2895         (WebKit::NetworkBlobRegistry::registerFileBlobURL):
2896         (WebKit::NetworkBlobRegistry::registerBlobURL):
2897         (WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked):
2898         (WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
2899         (WebKit::NetworkBlobRegistry::unregisterBlobURL):
2900         (WebKit::NetworkBlobRegistry::blobSize):
2901         (WebKit::NetworkBlobRegistry::writeBlobsToTemporaryFiles):
2902         (WebKit::NetworkBlobRegistry::writeBlobToFilePath):
2903         (WebKit::NetworkBlobRegistry::connectionToWebProcessDidClose):
2904         (WebKit::NetworkBlobRegistry::filesInBlob):
2905         (WebKit::NetworkBlobRegistry::singleton): Deleted.
2906         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
2907         (WebKit::NetworkBlobRegistry::blobRegistry):
2908         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2909         (WebKit::NetworkConnectionToWebProcess::didClose):
2910         (WebKit::NetworkConnectionToWebProcess::resolveBlobReferences):
2911         (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
2912         (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
2913         (WebKit::NetworkConnectionToWebProcess::loadPing):
2914         (WebKit::NetworkConnectionToWebProcess::preconnectTo):
2915         (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
2916         (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
2917         (WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL):
2918         (WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
2919         (WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
2920         (WebKit::NetworkConnectionToWebProcess::unregisterBlobURL):
2921         (WebKit::NetworkConnectionToWebProcess::blobSize):
2922         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
2923         (WebKit::NetworkConnectionToWebProcess::filesInBlob):
2924         (WebKit::NetworkConnectionToWebProcess::blobRegistry):
2925         * NetworkProcess/NetworkConnectionToWebProcess.h:
2926         * NetworkProcess/NetworkDataTask.cpp:
2927         (WebKit::NetworkDataTask::create):
2928         * NetworkProcess/NetworkDataTaskBlob.cpp:
2929         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
2930         * NetworkProcess/NetworkDataTaskBlob.h:
2931         * NetworkProcess/NetworkLoad.cpp:
2932         (WebKit::NetworkLoad::NetworkLoad):
2933         (WebKit::NetworkLoad::initialize):
2934         * NetworkProcess/NetworkLoad.h:
2935         * NetworkProcess/NetworkProcess.cpp:
2936         (WebKit::NetworkProcess::NetworkProcess):
2937         (WebKit::NetworkProcess::removeNetworkConnectionToWebProcess):
2938         * NetworkProcess/NetworkProcess.h:
2939         (WebKit::NetworkProcess::networkBlobRegistry):
2940         * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
2941         (WebKit::NetworkProcessPlatformStrategies::createBlobRegistry):
2942         * NetworkProcess/NetworkResourceLoader.cpp:
2943         (WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
2944         (WebKit::NetworkResourceLoader::startNetworkLoad):
2945         * NetworkProcess/PreconnectTask.cpp:
2946         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
2947         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
2948
2949 2019-02-05  Daniel Bates  <dabates@apple.com>
2950
2951         Fix a typo in r241006. Substitute Modifier for Modifiers.
2952
2953         * Shared/mac/NativeWebGestureEventMac.mm:
2954         (WebKit::NativeWebGestureEvent::NativeWebGestureEvent):
2955
2956 2019-02-05  Daniel Bates  <dabates@apple.com>
2957
2958         Attempt to fix the build following r241000
2959         (https://bugs.webkit.org/show_bug.cgi?id=194241)
2960
2961         Substitute OptionSet<WebEvent::Modifier> for Modifiers.
2962
2963         * Shared/mac/NativeWebGestureEventMac.mm:
2964         (WebKit::NativeWebGestureEvent::NativeWebGestureEvent):
2965         * Shared/mac/WebGestureEvent.h:
2966         (WebKit::WebGestureEvent::WebGestureEvent):
2967
2968 2019-02-05  Truitt Savell  <tsavell@apple.com>
2969
2970         Unreviewed, rolling out r240984.
2971
2972         Revision casued two API timeouts
2973
2974         Reverted changeset:
2975
2976         "Stop using blobRegistry in NetworkProcess"
2977         https://bugs.webkit.org/show_bug.cgi?id=194027
2978         https://trac.webkit.org/changeset/240984
2979
2980 2019-02-05  Youenn Fablet  <youenn@apple.com>
2981
2982         UserMediaPermissionRequestManagerProxy lambdas should check for 'this' being valid
2983         https://bugs.webkit.org/show_bug.cgi?id=194246
2984
2985         Reviewed by Eric Carlson.
2986
2987         With PSON enabled, the manager proxy can be destroyed.
2988         It is thus important for its callbacks to check for 'this' to be valid.
2989
2990         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2991         (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
2992         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
2993         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
2994
2995 2019-02-05  Daniel Bates  <dabates@apple.com>
2996
2997         Attempt to fix the build following r241000
2998         (https://bugs.webkit.org/show_bug.cgi?id=194241)
2999
3000         Substitute WebEvent::Modifier::CapsLockKey for WebEvent::CapsLockKey.
3001
3002         * Shared/gtk/WebEventFactory.cpp:
3003         (WebKit::modifiersForEvent):
3004         * Shared/mac/WebEventFactory.mm:
3005         (WebKit::modifiersForEvent):
3006         * UIProcess/API/Cocoa/WKNavigationAction.mm:
3007         (toNSEventModifierFlags):
3008         * UIProcess/Automation/WebAutomationSession.cpp:
3009         (WebKit::protocolModifierToWebEventModifier):
3010         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
3011         (WebKit::modifiersToEventState):
3012         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
3013         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
3014         * UIProcess/Cocoa/UIDelegate.mm:
3015         (WebKit::toNSEventModifierFlags):
3016
3017 2019-02-05  Daniel Bates  <dabates@apple.com>
3018
3019         Make WebEvent::Modifiers an OptionSet
3020         https://bugs.webkit.org/show_bug.cgi?id=194241
3021
3022         Reviewed by Simon Fraser.
3023
3024         Use an OptionSet to represent the bitmask of keyboard modifier flags. This improves type safety
3025         and makes debugging more enjoyable because our LLDB pretty-printers have built-in support for
3026         OptionSet.
3027
3028         While I am at it, make WebEvent::Modifier an enum class. It is currently an enum. This makes
3029         this enum more closely match WebCore::PlatformEvent::Modifier.
3030
3031         * Shared/API/c/WKSharedAPICast.h:
3032         (WebKit::toAPI):
3033         * Shared/NavigationActionData.cpp:
3034         (WebKit::NavigationActionData::encode const):
3035         (WebKit::NavigationActionData::decode):
3036         * Shared/NavigationActionData.h:
3037         * Shared/WebEvent.cpp:
3038         (WebKit::WebEvent::WebEvent):
3039         * Shared/WebEvent.h:
3040         (WebKit::WebEvent::shiftKey const):
3041         (WebKit::WebEvent::controlKey const):
3042         (WebKit::WebEvent::altKey const):
3043         (WebKit::WebEvent::metaKey const):
3044         (WebKit::WebEvent::capsLockKey const):
3045         (WebKit::WebEvent::modifiers const):
3046         (WebKit::WebTouchEvent::WebTouchEvent):
3047         * Shared/WebEventConversion.cpp:
3048         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
3049         * Shared/WebKeyboardEvent.cpp:
3050         (WebKit::WebKeyboardEvent::WebKeyboardEvent):
3051         * Shared/WebMouseEvent.cpp:
3052         (WebKit::WebMouseEvent::WebMouseEvent):
3053         * Shared/WebTouchEvent.cpp:
3054         (WebKit::WebTouchEvent::WebTouchEvent):
3055         * Shared/WebWheelEvent.cpp:
3056         (WebKit::WebWheelEvent::WebWheelEvent):
3057         * Shared/gtk/WebEventFactory.cpp:
3058         (WebKit::modifiersForEvent):
3059         * Shared/ios/NativeWebTouchEventIOS.mm:
3060         (WebKit::NativeWebTouchEvent::NativeWebTouchEvent):
3061         * Shared/ios/WebIOSEventFactory.mm:
3062         (modifiersForEvent):
3063         (WebIOSEventFactory::createWebKeyboardEvent):
3064         (WebIOSEventFactory::createWebMouseEvent):
3065         * Shared/libwpe/WebEventFactory.cpp:
3066         (WebKit::modifiersForEventModifiers):
3067         (WebKit::WebEventFactory::createWebWheelEvent):
3068         (WebKit::WebEventFactory::createWebTouchEvent):
3069         * Shared/mac/WebEventFactory.mm:
3070         (WebKit::modifiersForEvent):
3071         (WebKit::WebEventFactory::createWebMouseEvent):
3072         (WebKit::WebEventFactory::createWebWheelEvent):
3073         (WebKit::WebEventFactory::createWebKeyboardEvent):
3074         * Shared/win/WebEventFactory.cpp:
3075         (WebKit::modifiersForEvent):
3076         (WebKit::modifiersForCurrentKeyState):
3077         (WebKit::WebEventFactory::createWebMouseEvent):
3078         (WebKit::WebEventFactory::createWebWheelEvent):
3079         (WebKit::WebEventFactory::createWebKeyboardEvent):
3080         * UIProcess/API/APINavigationAction.h:
3081         * UIProcess/API/APIUIClient.h:
3082         (API::UIClient::mouseDidMoveOverElement):
3083         * UIProcess/API/C/WKPage.cpp:
3084         (WKPageSetPageUIClient):
3085         * UIProcess/API/Cocoa/WKNavigationAction.mm:
3086         (toNSEventModifierFlags):
3087         * UIProcess/API/glib/WebKitPrivate.cpp:
3088         (toPlatformModifiers):
3089         * UIProcess/API/glib/WebKitPrivate.h:
3090         * UIProcess/API/glib/WebKitUIClient.cpp:
3091         * UIProcess/API/glib/WebKitWebView.cpp:
3092         (webkitWebViewMouseTargetChanged):
3093         * UIProcess/API/glib/WebKitWebViewPrivate.h:
3094         * UIProcess/Automation/WebAutomationSession.cpp:
3095         (WebKit::WebAutomationSession::simulateMouseInteraction):
3096         (WebKit::protocolModifierToWebEventModifier):
3097         (WebKit::WebAutomationSession::performMouseInteraction):
3098         * UIProcess/Automation/WebAutomationSession.h:
3099         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
3100         (WebKit::modifiersToEventState):
3101         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
3102         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
3103         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
3104         * UIProcess/Automation/wpe/WebAutomationSessionWPE.cpp:
3105         (WebKit::modifiersToEventState):
3106         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
3107         * UIProcess/Cocoa/UIDelegate.h:
3108         * UIProcess/Cocoa/UIDelegate.mm:
3109         (WebKit::toNSEventModifierFlags):
3110         (WebKit::UIDelegate::UIClient::mouseDidMoveOverElement):
3111         * UIProcess/WebPageProxy.cpp:
3112         (WebKit::WebPageProxy::mouseDidMoveOverElement):
3113         * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
3114         (API::InjectedBundle::PageUIClient::mouseDidMoveOverElement):
3115         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
3116         (WebKit::InjectedBundleNavigationAction::modifiersForNavigationAction):
3117         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.h:
3118         (WebKit::InjectedBundleNavigationAction::modifiers const):
3119         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
3120         (WebKit::InjectedBundlePageUIClient::mouseDidMoveOverElement):
3121         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
3122         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3123         (WebKit::PDFPlugin::showContextMenuAtPoint):
3124         * WebProcess/Plugins/PluginView.cpp:
3125         (WebKit::PluginView::createWebEvent const):
3126         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3127         (WebKit::WebChromeClient::mouseDidMoveOverElement):
3128         * WebProcess/WebPage/WebPage.cpp:
3129         (WebKit::WebPage::simulateMouseDown):
3130         (WebKit::WebPage::simulateMouseUp):
3131         (WebKit::WebPage::simulateMouseMotion):
3132
3133 2019-02-05  Tim Horton  <timothy_horton@apple.com>
3134
3135         Reproducible crash under WKShareSheet presentWithParameters when cancelling a share
3136         https://bugs.webkit.org/show_bug.cgi?id=194301
3137         <rdar://problem/47719379>
3138
3139         Reviewed by Beth Dakin.
3140
3141         * UIProcess/Cocoa/WKShareSheet.mm:
3142         (-[WKShareSheet presentWithParameters:completionHandler:]):
3143         NSSharingServicePicker's delegate callbacks can be called synchronously.
3144         We release the WKShareSheet (which holds our reference to the NSSharingServicePicker)
3145         under sharingServicePicker:didChooseSharingService:. On older versions of macOS,
3146         there was nothing keeping the NSSharingServicePicker alive inside
3147         showRelativeToRect:ofView:preferredEdge:, thus the whole chain of references would
3148         fall and result in sending a message to a released NSSharingServicePicker.
3149         To resolve this, keep an extra reference to the WKShareSheet until
3150         presentation is complete.
3151
3152 2019-02-05  Keith Rollin  <krollin@apple.com>
3153
3154         Enable the automatic checking and regenerations of .xcfilelists during builds
3155         https://bugs.webkit.org/show_bug.cgi?id=194124
3156         <rdar://problem/47721277>
3157
3158         Reviewed by Tim Horton.
3159
3160         Bug 193790 add a facility for checking -- during build time -- that
3161         any needed .xcfilelist files are up-to-date and for updating them if
3162         they are not. This facility was initially opt-in by setting
3163         WK_ENABLE_CHECK_XCFILELISTS until other pieces were in place and until
3164         the process seemed robust. Its now time to enable this facility and
3165         make it opt-out. If there is a need to disable this facility, set and
3166         export WK_DISABLE_CHECK_XCFILELISTS=1 in your environment before
3167         running `make` or `build-webkit`, or before running Xcode from the
3168         command line.
3169
3170         Additionally, remove the step that generates a list of source files
3171         going into the UnifiedSources build step. It's only necessarily to
3172         specify Sources.txt and SourcesCocoa.txt as inputs.
3173
3174         * UnifiedSources-input.xcfilelist: Removed.
3175         * WebKit.xcodeproj/project.pbxproj:
3176
3177 2019-02-05  Brady Eidson  <beidson@apple.com>
3178
3179         Add a new DownloadMap type that manages taking an assertion automatically.
3180         https://bugs.webkit.org/show_bug.cgi?id=194294
3181
3182         Reviewed by Alex Christensen.
3183
3184         If we don't need the download assertion, we use a vanilla HashMap like today.
3185         If we need the download assertion, we use the new DownloadMap class instead.
3186
3187         The new DownloadMap is a wrapper around a HashMap that also creates/destroys the assertion as needed.
3188
3189         * NetworkProcess/Downloads/DownloadManager.cpp:
3190         (WebKit::DownloadManager::dataTaskBecameDownloadTask):
3191         (WebKit::DownloadManager::downloadFinished):
3192         * NetworkProcess/Downloads/DownloadManager.h:
3193
3194         * NetworkProcess/Downloads/DownloadMap.cpp: Added.
3195         (WebKit::DownloadMap::get const):
3196         (WebKit::DownloadMap::isEmpty const):
3197         (WebKit::DownloadMap::size const):
3198         (WebKit::DownloadMap::contains const):
3199         (WebKit::DownloadMap::add):
3200         (WebKit::DownloadMap::remove):
3201         * NetworkProcess/Downloads/DownloadMap.h: Added.
3202
3203         * Sources.txt:
3204
3205         * UIProcess/ios/ProcessAssertionIOS.mm:
3206         (WebKit::ProcessAssertion::ProcessAssertion):
3207
3208         * WebKit.xcodeproj/project.pbxproj:
3209
3210 2019-02-05  Brady Eidson  <beidson@apple.com>
3211
3212         Fix iOS simulator build after r240954
3213
3214         Unreviewed.
3215
3216         * UIProcess/ios/ProcessAssertionIOS.mm:
3217         (WebKit::ProcessAssertion::ProcessAssertion): Implement the new constructor.
3218
3219 2019-02-05  Alex Christensen  <achristensen@webkit.org>
3220
3221         Stop using blobRegistry in NetworkProcess
3222         https://bugs.webkit.org/show_bug.cgi?id=194027
3223
3224         Reviewed by Youenn Fablet.
3225
3226         * NetworkProcess/Downloads/DownloadManager.cpp:
3227         (WebKit::DownloadManager::startDownload):
3228         * NetworkProcess/Downloads/PendingDownload.cpp:
3229         (WebKit::PendingDownload::PendingDownload):
3230         * NetworkProcess/Downloads/PendingDownload.h:
3231         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
3232         (WebKit::NetworkBlobRegistry::registerFileBlobURL):
3233         (WebKit::NetworkBlobRegistry::registerBlobURL):
3234         (WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked):
3235         (WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
3236         (WebKit::NetworkBlobRegistry::unregisterBlobURL):
3237         (WebKit::NetworkBlobRegistry::blobSize):
3238         (WebKit::NetworkBlobRegistry::writeBlobsToTemporaryFiles):
3239         (WebKit::NetworkBlobRegistry::writeBlobToFilePath):
3240         (WebKit::NetworkBlobRegistry::connectionToWebProcessDidClose):
3241         (WebKit::NetworkBlobRegistry::filesInBlob):
3242         (WebKit::NetworkBlobRegistry::singleton): Deleted.
3243         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
3244         (WebKit::NetworkBlobRegistry::blobRegistry):
3245         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3246         (WebKit::NetworkConnectionToWebProcess::didClose):
3247         (WebKit::NetworkConnectionToWebProcess::resolveBlobReferences):
3248         (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
3249         (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
3250         (WebKit::NetworkConnectionToWebProcess::loadPing):
3251         (WebKit::NetworkConnectionToWebProcess::preconnectTo):
3252         (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
3253         (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
3254         (WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL):
3255         (WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
3256         (WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
3257         (WebKit::NetworkConnectionToWebProcess::unregisterBlobURL):
3258         (WebKit::NetworkConnectionToWebProcess::blobSize):
3259         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
3260         (WebKit::NetworkConnectionToWebProcess::filesInBlob):
3261         (WebKit::NetworkConnectionToWebProcess::blobRegistry):
3262         * NetworkProcess/NetworkConnectionToWebProcess.h:
3263         * NetworkProcess/NetworkDataTask.cpp:
3264         (WebKit::NetworkDataTask::create):
3265         * NetworkProcess/NetworkDataTaskBlob.cpp:
3266         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
3267         * NetworkProcess/NetworkDataTaskBlob.h:
3268         * NetworkProcess/NetworkLoad.cpp:
3269         (WebKit::NetworkLoad::NetworkLoad):
3270         (WebKit::NetworkLoad::initialize):
3271         * NetworkProcess/NetworkLoad.h:
3272         * NetworkProcess/NetworkProcess.cpp:
3273         (WebKit::NetworkProcess::NetworkProcess):
3274         (WebKit::NetworkProcess::removeNetworkConnectionToWebProcess):
3275         * NetworkProcess/NetworkProcess.h:
3276         (WebKit::NetworkProcess::networkBlobRegistry):
3277         * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
3278         (WebKit::NetworkProcessPlatformStrategies::createBlobRegistry):
3279         * NetworkProcess/NetworkResourceLoader.cpp:
3280         (WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
3281         (WebKit::NetworkResourceLoader::startNetworkLoad):
3282         * NetworkProcess/PreconnectTask.cpp:
3283         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
3284         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
3285
3286 2019-02-05  Ryan Haddad  <ryanhaddad@apple.com>
3287
3288         Unreviewed, rolling out r240742.
3289
3290         Causes crashes on iOS simulator.
3291
3292         Reverted changeset:
3293
3294         "[iOS] Keyups for non-modifier keys identified as "Dead" when
3295         not focused in a content-editable element"
3296         https://bugs.webkit.org/show_bug.cgi?id=192824
3297         https://trac.webkit.org/changeset/240742
3298
3299 2019-02-05  Alex Christensen  <achristensen@webkit.org>
3300
3301         Protect globalWebSocketStreamMap with a Lock
3302         https://bugs.webkit.org/show_bug.cgi?id=194224
3303         <rdar://problem/47581081>
3304
3305         Reviewed by Ryosuke Niwa.
3306
3307         * WebProcess/Network/WebSocketStream.cpp:
3308         (WebKit::WebSocketStream::streamWithIdentifier):
3309         (WebKit::WebSocketStream::networkProcessCrashed):
3310         (WebKit::WebSocketStream::WebSocketStream):
3311         (WebKit::WebSocketStream::~WebSocketStream):
3312
3313 2019-02-04  Alex Christensen  <achristensen@webkit.org>
3314
3315         Add Networking Daemon skeleton
3316         https://bugs.webkit.org/show_bug.cgi?id=194278
3317
3318         Reviewed by Zalan Bujtas.
3319
3320         Daemon skeletons? This is spooky stuff.
3321
3322         * NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.h: Added.
3323         * NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm: Added.
3324         (WebKit::DaemonMain):
3325         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
3326         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3327         (WebKit::NetworkDataTaskCocoa::restrictRequestReferrerToOriginIfNeeded):
3328         * Shared/API/Cocoa/WKMain.h:
3329         * Shared/API/Cocoa/WKMain.mm:
3330         (WKDaemonMain):
3331         * Shared/EntryPointUtilities/Cocoa/AuxiliaryProcessMain.cpp:
3332         (main):
3333         * SourcesCocoa.txt:
3334         * UnifiedSources-input.xcfilelist:
3335         * WebKit.xcodeproj/project.pbxproj:
3336
3337 2019-02-04  Yusuke Suzuki  <ysuzuki@apple.com>
3338
3339         [JSC] Shrink size of VM by lazily allocating IsoSubspaces for non-common types
3340         https://bugs.webkit.org/show_bug.cgi?id=193993
3341
3342         Reviewed by Keith Miller.
3343
3344         * WebProcess/Plugins/Netscape/JSNPMethod.h:
3345         * WebProcess/Plugins/Netscape/JSNPObject.h:
3346
3347 2019-02-04  Simon Fraser  <simon.fraser@apple.com>
3348
3349         Move some macOS/iOS scrolling code into the scrolling/cocoa directory
3350         https://bugs.webkit.org/show_bug.cgi?id=194245
3351
3352         Reviewed by Zalan Bujtas.
3353
3354         Use PLATFORM(MAC), not !PLATFORM(IOS_FAMILY).
3355
3356         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
3357         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3358
3359 2019-02-04  Ms2ger  <Ms2ger@igalia.com>
3360
3361         [GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
3362         https://bugs.webkit.org/show_bug.cgi?id=174816
3363
3364         Reviewed by Michael Catanzaro.
3365
3366         Add webkit_uri_for_display for GTK and WPE.
3367
3368         * PlatformGTK.cmake:
3369         * PlatformWPE.cmake:
3370         * SourcesGTK.txt:
3371         * SourcesWPE.txt:
3372         * UIProcess/API/glib/WebKitURIUtilities.cpp: Added.
3373         (webkit_uri_for_display):
3374         * UIProcess/API/gtk/WebKitURIUtilities.h: Added.
3375         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
3376         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
3377         * UIProcess/API/gtk/webkit2.h:
3378         * UIProcess/API/wpe/WebKitURIUtilities.h: Added.
3379         * UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
3380         * UIProcess/API/wpe/docs/wpe-docs.sgml:
3381         * UIProcess/API/wpe/webkit.h:
3382
3383 2019-02-04  Alex Christensen  <achristensen@webkit.org>
3384
3385         Move XPCService main to a shared file calling a C function
3386         https://bugs.webkit.org/show_bug.cgi?id=194256
3387
3388         Reviewed by Brady Eidson.
3389
3390         This not only reduces a few kilobytes of duplicated binary from the XPCService executables,
3391         It will allow me to introduce a new kind of executable which will need to parse argv and call a different C function.
3392         This is similar to r236075 but more general.
3393
3394         * Shared/API/Cocoa/WKMain.h: Added.
3395         * Shared/API/Cocoa/WKMain.mm: Added.
3396         (WKXPCServiceMain):
3397         * Shared/EntryPointUtilities/Cocoa/AuxiliaryProcessMain.cpp: Added.
3398         (main):
3399         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
3400         (main): Deleted.
3401         * SourcesCocoa.txt:
3402         * WebKit.xcodeproj/project.pbxproj:
3403
3404 2019-02-04  Alex Christensen  <achristensen@webkit.org>
3405
3406         Make MessageSender functions const
3407         https://bugs.webkit.org/show_bug.cgi?id=194247
3408
3409         Reviewed by Brady Eidson.
3410
3411         * NetworkProcess/Downloads/Download.cpp:
3412         (WebKit::Download::messageSenderConnection const):
3413         (WebKit::Download::messageSenderDestinationID const):
3414         (WebKit::Download::messageSenderConnection): Deleted.
3415         (WebKit::Download::messageSenderDestinationID): Deleted.
3416         * NetworkProcess/Downloads/Download.h:
3417         * NetworkProcess/Downloads/PendingDownload.cpp:
3418         (WebKit::PendingDownload::messageSenderConnection const):
3419         (WebKit::PendingDownload::messageSenderDestinationID const):
3420         (WebKit::PendingDownload::messageSenderConnection): Deleted.
3421         (WebKit::PendingDownload::messageSenderDestinationID): Deleted.
3422         * NetworkProcess/Downloads/PendingDownload.h:
3423         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
3424         (WebKit::WebIDBConnectionToClient::messageSenderConnection const):
3425         (WebKit::WebIDBConnectionToClient::messageSenderConnection): Deleted.
3426         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
3427         * NetworkProcess/NetworkResourceLoader.cpp:
3428         (WebKit::NetworkResourceLoader::messageSenderConnection const):
3429         (WebKit::NetworkResourceLoader::messageSenderConnection): Deleted.
3430         * NetworkProcess/NetworkResourceLoader.h:
3431         * NetworkProcess/NetworkSocketStream.cpp:
3432         (WebKit::NetworkSocketStream::messageSenderConnection const):
3433         (WebKit::NetworkSocketStream::messageSenderDestinationID const):
3434         (WebKit::NetworkSocketStream::messageSenderConnection): Deleted.
3435         (WebKit::NetworkSocketStream::messageSenderDestinationID): Deleted.
3436         * NetworkProcess/NetworkSocketStream.h:
3437         * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
3438         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
3439         (WebKit::WebSWServerToContextConnection::messageSenderConnection const):
3440         (WebKit::WebSWServerToContextConnection::messageSenderDestinationID const):
3441         (WebKit::WebSWServerToContextConnection::messageSenderConnection): Deleted.
3442         (WebKit::WebSWServerToContextConnection::messageSenderDestinationID): Deleted.
3443         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
3444         * Platform/IPC/MessageSender.h:
3445         * Shared/AuxiliaryProcess.cpp:
3446         (WebKit::AuxiliaryProcess::messageSenderConnection const):
3447         (WebKit::AuxiliaryProcess::messageSenderDestinationID const):
3448         (WebKit::AuxiliaryProcess::messageSenderConnection): Deleted.
3449         (WebKit::AuxiliaryProcess::messageSenderDestinationID): Deleted.
3450         * Shared/AuxiliaryProcess.h:
3451         * UIProcess/WebConnectionToWebProcess.cpp:
3452         (WebKit::WebConnectionToWebProcess::messageSenderConnection const):
3453         (WebKit::WebConnectionToWebProcess::messageSenderDestinationID const):
3454         (WebKit::WebConnectionToWebProcess::messageSenderConnection): Deleted.
3455         (WebKit::WebConnectionToWebProcess::messageSenderDestinationID): Deleted.
3456         * UIProcess/WebConnectionToWebProcess.h:
3457         * UIProcess/WebPageProxy.cpp:
3458         (WebKit::WebPageProxy::messageSenderConnection const):
3459         (WebKit::WebPageProxy::messageSenderDestinationID const):
3460         (WebKit::WebPageProxy::messageSenderConnection): Deleted.
3461         (WebKit::WebPageProxy::messageSenderDestinationID): Deleted.
3462         * UIProcess/WebPageProxy.h:
3463         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
3464         (WebKit::WebIDBConnectionToServer::messageSenderConnection const):
3465         (WebKit::WebIDBConnectionToServer::messageSenderConnection): Deleted.
3466         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
3467         * WebProcess/Network/WebResourceLoader.cpp:
3468         (WebKit::WebResourceLoader::messageSenderConnection const):
3469         (WebKit::WebResourceLoader::messageSenderDestinationID const):
3470         (WebKit::WebResourceLoader::messageSenderConnection): Deleted.
3471         (WebKit::WebResourceLoader::messageSenderDestinationID): Deleted.
3472         * WebProcess/Network/WebResourceLoader.h:
3473         * WebProcess/Network/WebSocketStream.cpp:
3474         (WebKit::WebSocketStream::messageSenderConnection const):
3475         (WebKit::WebSocketStream::messageSenderDestinationID const):
3476         (WebKit::WebSocketStream::messageSenderConnection): Deleted.
3477         (WebKit::WebSocketStream::messageSenderDestinationID): Deleted.
3478         * WebProcess/Network/WebSocketStream.h:
3479         * WebProcess/Storage/WebSWClientConnection.h:
3480         * WebProcess/WebConnectionToUIProcess.cpp:
3481         (WebKit::WebConnectionToUIProcess::messageSenderConnection const):
3482         (WebKit::WebConnectionToUIProcess::messageSenderDestinationID const):
3483         (WebKit::WebConnectionToUIProcess::messageSenderConnection): Deleted.
3484         (WebKit::WebConnectionToUIProcess::messageSenderDestinationID): Deleted.
3485         * WebProcess/WebConnectionToUIProcess.h:
3486         * WebProcess/WebPage/WebPage.cpp:
3487         (WebKit::WebPage::messageSenderConnection const):
3488         (WebKit::WebPage::messageSenderDestinationID const):
3489         (WebKit::WebPage::messageSenderConnection): Deleted.
3490         (WebKit::WebPage::messageSenderDestinationID): Deleted.
3491         * WebProcess/WebPage/WebPage.h:
3492
3493 2019-02-04  Brady Eidson  <beidson@apple.com>
3494
3495         Take additional process assertion while downloading.
3496         <rdar://problem/47741356> and https://bugs.webkit.org/show_bug.cgi?id=194239
3497
3498         Reviewed by Chris Dumez.
3499
3500         When the first download starts, grab this new assertion.
3501         When the last download ends, release it.
3502
3503         * Configurations/Network-iOS.entitlements:
3504
3505         * NetworkProcess/Downloads/DownloadManager.cpp:
3506         (WebKit::DownloadManager::dataTaskBecameDownloadTask):
3507         (WebKit::DownloadManager::downloadFinished):
3508         * NetworkProcess/Downloads/DownloadManager.h:
3509
3510         * Platform/spi/ios/AssertionServicesSPI.h:
3511
3512         * UIProcess/ProcessAssertion.cpp:
3513         (WebKit::ProcessAssertion::ProcessAssertion):
3514         * UIProcess/ProcessAssertion.h:
3515         (WebKit::ProcessAssertion::ProcessAssertion):
3516
3517         * UIProcess/WebProcessProxy.cpp:
3518         (WebKit::WebProcessProxy::didSetAssertionState):
3519
3520         * UIProcess/ios/ProcessAssertionIOS.mm:
3521         (WebKit::flagsForState):
3522         (WebKit::reasonForState):
3523         (WebKit::ProcessAssertion::ProcessAssertion):
3524
3525 2019-02-04  Said Abou-Hallawa  <said@apple.com>
3526
3527         [CG] Enable setAdditionalSupportedImageTypes for WK1
3528         https://bugs.webkit.org/show_bug.cgi?id=194190
3529
3530         Reviewed by Tim Horton.
3531
3532         Move the function webCoreStringVectorFromNSStringArray from WebKit to
3533         WebCore so it can be used by both WebKit and WebKitLegacy.
3534
3535         * Platform/mac/StringUtilities.h:
3536         * Platform/mac/StringUtilities.mm:
3537         (WebKit::webCoreStringVectorFromNSStringArray): Deleted.
3538         * UIProcess/API/Cocoa/WKWebView.mm:
3539         (-[WKWebView _initializeWithConfiguration:]):
3540
3541 2019-02-04  Benjamin Poulain  <benjamin@webkit.org>
3542
3543         Use deferrable timer to restart the Responsiveness Timer on each wheel event
3544         https://bugs.webkit.org/show_bug.cgi?id=194135
3545
3546         Reviewed by Simon Fraser.
3547
3548         Simon Fraser suggested a neat improvement over my previous optimization
3549         of ResponsivenessTimer.
3550
3551         Instead of reseting the deadline with every event, we can let the timer
3552         fire and add the missing time from the last start.
3553
3554         I implemented that behavior in the new Deferrable Timer class and use
3555         it from ResponsivenessTimer.
3556
3557         * NetworkProcess/watchos/NetworkProximityAssertion.h:
3558         * UIProcess/ResponsivenessTimer.h:
3559         * WebProcess/Plugins/PluginView.h:
3560
3561 2019-02-04  Simon Fraser  <simon.fraser@apple.com>
3562
3563         PageOverlayController's layers should be created lazily
3564         https://bugs.webkit.org/show_bug.cgi?id=194199
3565         rdar://problem/46571593
3566
3567         Reviewed by Tim Horton.
3568         
3569         Expose PageOverlayController::hasDocumentOverlays() and hasViewOverlays()
3570         and use them to only parent the overlay-hosting layers when necessary.
3571
3572         For document overlays, RenderLayerCompositor::appendDocumentOverlayLayers() can
3573         simply do nothing if there are none. Updates are triggered via Page::installedPageOverlaysChanged(),
3574         which calls FrameView::setNeedsCompositingConfigurationUpdate() to trigger the root layer
3575         compositing updates that parents the layerWithDocumentOverlays().
3576
3577         View overlays are added to the layer tree via the DrawingArea. When we go between having
3578         none and some view overlays, Page::installedPageOverlaysChanged() calls attachViewOverlayGraphicsLayer()
3579         on the ChromeClient, and the DrawingArea responds by calling updateRootLayers() and scheduling a
3580         compositing flush (this has to be done manually because view overlay layers are outside the
3581         subtree managed by RenderLayerCompositor).
3582         
3583         Now that GraphicsLayers are ref-counted, we can let the DrawingArea simply retain its m_viewOverlayRootLayer;
3584         there is no need for RenderLayerCompositor::attachRootLayer()/detachRootLayer() to do anything with view
3585         overlay layers. This implies that a page can navigate (new FrameView) and view overlays will persist, without
3586         having to be manually removed and re-added. We can also remove the Frame argument to attachViewOverlayGraphicsLayer().
3587
3588         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3589         (WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
3590         * WebProcess/WebCoreSupport/WebChromeClient.h:
3591         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
3592         (WebKit::AcceleratedDrawingArea::attachViewOverlayGraphicsLayer):
3593         * WebProcess/WebPage/AcceleratedDrawingArea.h:
3594         * WebProcess/WebPage/DrawingArea.h:
3595         (WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
3596         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
3597         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
3598         (WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
3599         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
3600         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3601         (WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
3602         (WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
3603
3604 2019-02-04  Michael Catanzaro  <mcatanzaro@igalia.com>
3605
3606         Unreviewed, improve preprocessor guard
3607         https://bugs.webkit.org/show_bug.cgi?id=194166
3608         <rdar://problem/47694328>
3609
3610         AC mode is only optional in GTK port. Requested by Zan.
3611
3612         * WebProcess/WebPage/WebPage.cpp:
3613         (WebKit::WebPage::updatePreferences):
3614
3615 2019-02-04  Sihui Liu  <sihui_liu@apple.com>
3616
3617         IndexedDB: leak WebIDBConnectionToServer in layout tests
3618         https://bugs.webkit.org/show_bug.cgi?id=193688
3619         <rdar://problem/47353263>
3620
3621         Reviewed by Geoffrey Garen.
3622
3623         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3624         (WebKit::NetworkConnectionToWebProcess::didClose):
3625         (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
3626         (WebKit::NetworkConnectionToWebProcess::removeIDBConnectionToServer): Deleted.
3627         * NetworkProcess/NetworkConnectionToWebProcess.h:
3628         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3629         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
3630         (WebKit::WebIDBConnectionToServer::~WebIDBConnectionToServer):
3631
3632 2019-02-04  Antoine Quint  <graouts@apple.com>
3633
3634         <rdar://problem/47788802>
3635
3636         Unreviewed build fix.
3637
3638         * Platform/spi/ios/UIKitSPI.h:
3639
3640 2019-02-04  Youenn Fablet  <youenn@apple.com>
3641
3642         Capture state should be managed consistently when doing process swapping
3643         https://bugs.webkit.org/show_bug.cgi?id=194122
3644         <rdar://problem/47609293>
3645
3646         Reviewed by Eric Carlson.
3647
3648         When doing PSON, WebPageProxy::resetState is called.
3649         It resets the media state, but does not call the client delegates.
3650         Instead of directly updating the media state, call the routine used to update it so that client delegates are called.
3651
3652         Covered by new API test and layout test.
3653
3654         * UIProcess/API/Cocoa/WKWebView.mm:
3655         (-[WKWebView _mediaCaptureState]):
3656         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3657         * UIProcess/WebPageProxy.cpp:
3658         (WebKit::WebPageProxy::resetState):
3659         (WebKit::WebPageProxy::isPlayingMediaDidChange):
3660         (WebKit::WebPageProxy::updatePlayingMediaDidChange):
3661         * UIProcess/WebPageProxy.h:
3662
3663 2019-02-04  Antoine Quint  <graouts@apple.com>
3664
3665         Use a dedicated type instead of int32_t for pointer identifiers
3666         https://bugs.webkit.org/show_bug.cgi?id=194217
3667
3668         Reviewed by Antti Koivisto.
3669
3670         * Scripts/webkit/messages.py:
3671         * UIProcess/WebPageProxy.cpp:
3672         (WebKit::WebPageProxy::cancelPointer):
3673         * UIProcess/WebPageProxy.h:
3674         * WebProcess/WebPage/WebPage.cpp:
3675         (WebKit::WebPage::cancelPointer):
3676         * WebProcess/WebPage/WebPage.h:
3677         * WebProcess/WebPage/WebPage.messages.in:
3678
3679 2019-02-04  Michael Catanzaro  <mcatanzaro@igalia.com>
3680
3681         Unreviewed, avoid -Wswitch warnings introduced in r240880
3682         https://bugs.webkit.org/show_bug.cgi?id=193740
3683         <rdar://problem/47527267>
3684
3685         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
3686         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse):
3687
3688 2019-02-04  Alexander Mikhaylenko  <exalm7659@gmail.com>
3689
3690         [GTK] Allow pinch zoom on touchpad
3691         https://bugs.webkit.org/show_bug.cgi?id=194201
3692
3693         Reviewed by Michael Catanzaro.
3694
3695         Enable touchpad events for WebkitWebViewBase, then feed touchpad
3696         pinch events to GestureController.
3697
3698         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3699         (webkitWebViewBaseRealize): Added GDK_TOUCHPAD_GESTURE_MASK to event mask.
3700         (webkitWebViewBaseEvent): Added.
3701         (webkit_web_view_base_class_init): Override event vfunc.
3702
3703 2019-02-04  Michael Catanzaro  <mcatanzaro@igalia.com>
3704
3705         Unreviewed, only force settings.acceleratedCompositingEnabled() to true for Cocoa ports
3706         https://bugs.webkit.org/show_bug.cgi?id=194166
3707         <rdar://problem/47694328>
3708
3709         Accelerated compositing is broken for me at least. We're a long way from being able to force
3710         it.
3711
3712         * WebProcess/WebPage/WebPage.cpp:
3713         (WebKit::WebPage::updatePreferences):
3714
3715 2019-02-04  Abderrahim Kitouni  <akitouni@gnome.org>
3716
3717         [GTK] Remove last python2 dependency from CMake build process
3718         https://bugs.webkit.org/show_bug.cgi?id=194218
3719
3720         Reviewed by Michael Catanzaro.
3721
3722         * InspectorGResources.cmake:
3723
3724 2019-02-04  Antti Koivisto  <antti@apple.com>
3725
3726         Rename GraphicsLayer and PlatformCALayer type enum values to match "scroll container layer" convention
3727         https://bugs.webkit.org/show_bug.cgi?id=194215
3728
3729         Reviewed by Frédéric Wang.
3730
3731         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
3732         (WebKit::RemoteLayerBackingStore::drawInContext):
3733         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
3734         (WebKit::RemoteLayerTreeHost::makeNode):
3735         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
3736         (WebKit::RemoteLayerTreeHost::makeNode):
3737
3738 2019-02-03  Antti Koivisto  <antti@apple.com>
3739
3740         [iOS] Tiles not created in large scrollable iframes
3741         https://bugs.webkit.org/show_bug.cgi?id=193665
3742
3743         Reviewed by Simon Fraser.
3744
3745         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
3746         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
3747         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
3748         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateBeforeChildren):
3749
3750         We now use scrollContainerLayer consistently so remove the special cases.
3751
3752 2019-02-03  Fujii Hironori  <Hironori.Fujii@sony.com>
3753
3754         [curl] [WebKit] Assertion failures of missing networkStorageSession for storage/indexeddb tests
3755         https://bugs.webkit.org/show_bug.cgi?id=194141
3756
3757         Reviewed by Ross Kirsling.
3758
3759         Implemented WebKit::NetworkProcess::switchToNewTestingSession and
3760         WebKit::NetworkProcess::ensureSession for curl port.
3761
3762         * NetworkProcess/NetworkProcess.cpp:
3763         (WebKit::NetworkProcess::switchToNewTestingSession):
3764         (WebKit::NetworkProcess::ensureSession):
3765
3766 2019-02-03  Simon Fraser  <simon.fraser@apple.com>
3767
3768         Make setNeedsLayout on the root more explicitly about triggering its side-effects
3769         https://bugs.webkit.org/show_bug.cgi?id=194198
3770
3771         Reviewed by Antti Koivisto.
3772
3773         Call the newly named functions.
3774
3775         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3776         (WebKit::PDFPlugin::updateScrollbars):
3777         * WebProcess/Plugins/PluginView.cpp:
3778         (WebKit::PluginView::didInitializePlugin):
3779         * WebProcess/WebPage/WebPage.cpp:
3780         (WebKit::WebPage::setHeaderBannerHeightForTesting):
3781         (WebKit::WebPage::setFooterBannerHeightForTesting):
3782         * WebProcess/WebPage/mac/PageBannerMac.mm:
3783         (WebKit::PageBanner::addToPage):
3784         (WebKit::PageBanner::detachFromPage):
3785         (WebKit::PageBanner::hide):
3786
3787 2019-02-03  Ryosuke Niwa  <rniwa@webkit.org>
3788
3789         Validate navigation policy decisions to avoid crashes in continueLoadAfterNavigationPolicy
3790         https://bugs.webkit.org/show_bug.cgi?id=194189
3791
3792         Reviewed by Geoffrey Garen.
3793
3794         Pass the policy check identifier around functions and store it in PolicyDecisionSender
3795         so that we can send it back to WebCore with the navigation policy decision.
3796
3797         We also store it in WebFrame in the case the policy decision had to be invalidated
3798         before the decision was received (via WebFrame::invalidatePolicyListener).
3799
3800         * Scripts/webkit/messages.py:
3801         * UIProcess/ProvisionalPageProxy.cpp:
3802         (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
3803         (WebKit::ProvisionalPageProxy::decidePolicyForResponse):
3804         * UIProcess/ProvisionalPageProxy.h:
3805         * UIProcess/WebPageProxy.cpp:
3806         (WebKit::WebPageProxy::PolicyDecisionSender): Added PolicyCheckIdentifier as a member.
3807         (WebKit::WebPageProxy::PolicyDecisionSender::create):
3808         (WebKit::WebPageProxy::PolicyDecisionSender::send):
3809         (WebKit::WebPageProxy::PolicyDecisionSender::PolicyDecisionSender):
3810         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
3811         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
3812         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
3813         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3814         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
3815         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
3816         (WebKit::WebPageProxy::decidePolicyForResponse):
3817         (WebKit::WebPageProxy::decidePolicyForResponseShared):
3818         * UIProcess/WebPageProxy.h:
3819         * UIProcess/WebPageProxy.messages.in:
3820         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3821         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
3822         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
3823         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3824         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3825         * WebProcess/WebPage/WebFrame.cpp:
3826         (WebKit::WebFrame::setUpPolicyListener):
3827         (WebKit::WebFrame::invalidatePolicyListener):
3828         (WebKit::WebFrame::didReceivePolicyDecision):
3829         * WebProcess/WebPage/WebFrame.h:
3830         * WebProcess/WebPage/WebPage.cpp:
3831         (WebKit::WebPage::didReceivePolicyDecision):
3832         * WebProcess/WebPage/WebPage.h:
3833         * WebProcess/WebPage/WebPage.messages.in:
3834
3835 2019-02-03  Megan Gardner  <megan_gardner@apple.com>
3836
3837         Turn on Smart Paste
3838         https://bugs.webkit.org/show_bug.cgi?id=193786
3839
3840         Reviewed by Ryosuke Niwa.
3841
3842         * Platform/spi/ios/UIKitSPI.h:
3843         * UIProcess/ios/TextCheckerIOS.mm:
3844         (WebKit::TextChecker::isSmartInsertDeleteEnabled):
3845         Use the flag from UIKit to determine if smart copy paste should be
3846         turned on.
3847
3848 2019-02-02  Simon Fraser  <simon.fraser@apple.com>
3849
3850         Tidy up data memebers of FrameView and related classes to shrink class sizes
3851         https://bugs.webkit.org/show_bug.cgi?id=194197
3852
3853         Reviewed by Zalan Bujtas.
3854
3855         * UIProcess/PageClient.h: Declare enum size.
3856
3857 2018-12-16  Darin Adler  <darin@apple.com>
3858
3859         Convert additional String::format clients to alternative approaches
3860         https://bugs.webkit.org/show_bug.cgi?id=192746
3861
3862         Reviewed by Alexey Proskuryakov.
3863
3864         * UIProcess/Cocoa/ViewGestureController.cpp:
3865         (WebKit::ViewGestureController::SnapshotRemovalTracker::startWatchdog):
3866         Use makeString and FormattedNumber.
3867
3868         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
3869         (WebKit::LocalAuthenticator::getAssertion): Added a comment about an
3870         incorrect format specifier and left this code as is for now.
3871
3872 2019-02-01  David Kilzer  <ddkilzer@apple.com>
3873
3874         Move soft-linking of TelephonyUtilities.framework out of TUCallSPI.h
3875         <https://webkit.org/b/193866>
3876
3877         Reviewed by Alex Christensen.
3878
3879         * Platform/mac/MenuUtilities.mm:
3880         - Update for rename of TUCallSPI.h to TelephonyUtilitiesSPI.h.
3881         - Add soft-linking code formerly in TUCallSPI.h.
3882
3883 2019-02-01  Alex Christensen  <achristensen@webkit.org>
3884
3885         Move XPCService entry points from mac directory to new Cocoa directory
3886         https://bugs.webkit.org/show_bug.cgi?id=194129
3887
3888         Reviewed by Chris Dumez.
3889
3890         * Configurations/NetworkService.xcconfig:
3891         * Configurations/PluginService.64.xcconfig:
3892         * Configurations/WebContentService.xcconfig:
3893         * NetworkProcess/EntryPoint/Cocoa: Copied from Source/WebKit/NetworkProcess/EntryPoint/mac.
3894         * NetworkProcess/EntryPoint/mac: Removed.
3895         * PluginProcess/EntryPoint/Cocoa: Copied from Source/WebKit/PluginProcess/EntryPoint/mac.
3896         * PluginProcess/EntryPoint/mac: Removed.
3897         * Shared/EntryPointUtilities/Cocoa: Copied from Source/WebKit/Shared/EntryPointUtilities/mac.
3898         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
3899         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm:
3900         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
3901         * Shared/EntryPointUtilities/mac: Removed.
3902         * SourcesCocoa.txt:
3903         * WebKit.xcodeproj/project.pbxproj:
3904         * WebProcess/EntryPoint/Cocoa: Copied from Source/WebKit/WebProcess/EntryPoint/mac.
3905         * WebProcess/EntryPoint/mac: Removed.
3906
3907 2019-02-01  Wenson Hsieh  <wenson_hsieh@apple.com>
3908
3909         [iOS] Consistent 1 sec hang when triggering modal alerts while handling synchronous touch events
3910         https://bugs.webkit.org/show_bug.cgi?id=194140
3911         <rdar://problem/47728098>
3912
3913         Reviewed by Tim Horton.
3914
3915         Currently, the UI process hangs when attempting to synchronously present modal UI from the web process while the
3916         UI process is waiting for sync IPC in the web process. While we have logic to generally mitigate IPC deadlock in
3917         this scenario by dispatching the web process' sync IPC immediately with the intention of allowing the web
3918         process to finish processing sync IPC (and consequently unblock the UI process), this fails in the case where
3919         the sync IPC message from the web process to the UI process requires main thread execution for an arbitrary
3920         amount of time (for instance, modal alert dialogs). In this case, we'll end up in a state where we've handled
3921         the web process' sync IPC in the UI process, yet we can't resume execution since the web process is still
3922         blocked.
3923
3924         By far the most egregious scenario in which this manifests is during synchronous gesture recognizer IPC, i.e.
3925         grabbing position information from the UI process, and handling touch events synchronously. Luckily, these are
3926         also cases where (1) we know sync IPC may safely time out, and (2) the presentation of modal UI from the web
3927         process should cause the gesture recognizers to fail anyways. As such, we can mitigate these scenarios in the
3928         web process by responding to the these pending sync IPC messages *before* sending our own sync IPC to the UI
3929         process.
3930
3931         Test: fast/events/touch/ios/show-modal-alert-during-touch-start.html
3932
3933         * Shared/ios/InteractionInformationAtPosition.h:
3934         (WebKit::InteractionInformationAtPosition::invalidInformation):
3935         * Shared/ios/InteractionInformationAtPosition.mm:
3936         (WebKit::InteractionInformationAtPosition::encode const):
3937         (WebKit::InteractionInformationAtPosition::decode):
3938
3939         Add a new flag to indicate whether an interaction information response can be valid. Interaction information
3940         cannot be valid in the case where the interaction information request was interrupted by certain sync IPC
3941         messages from the web process.
3942
3943         * UIProcess/API/C/WKContextConfigurationRef.cpp:
3944         (WKContextConfigurationIgnoreSynchronousMessagingTimeoutsForTesting):
3945         (WKContextConfigurationSetIgnoreSynchronousMessagingTimeoutsForTesting):
3946
3947         Add some testing SPI to ignore sync IPC timeouts, for the purposes of testing. Rather than use the existing
3948         Objective-C SPI in WKWebProcessPoolConfiguration, I decided to add C API plumbing for this flag, so that other
3949         non-Cocoa ports may also support the new layout test option to ignore sync IPC timeouts.
3950
3951         * UIProcess/API/C/WKContextConfigurationRef.h:
3952         * UIProcess/ios/WKContentViewInteraction.mm:
3953         (-[WKContentView ensurePositionInformationIsUpToDate:]):
3954         (-[WKContentView _positionInformationDidChange:]):
3955         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3956         (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel):
3957         (WebKit::WebChromeClient::runJavaScriptAlert):
3958         (WebKit::WebChromeClient::runJavaScriptConfirm):
3959         (WebKit::WebChromeClient::runJavaScriptPrompt):
3960         (WebKit::WebChromeClient::print):
3961         (WebKit::WebChromeClient::exceededDatabaseQuota):
3962         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
3963
3964         Cancel any pending sync IPC replies prior to sending sync IPC messages to the UI process which may result in
3965         sync IPC deadlock, by using the new helper method, sendSyncWithDelayedReply, instead of just sendSync.
3966
3967         * WebProcess/WebPage/WebPage.cpp:
3968         (WebKit::WebPage::cancelGesturesBlockedOnSynchronousReplies):
3969
3970         Add a helper to cancel pending sync messages coming in from the UI process that are being called from within
3971         gesture recognizer delegate hooks.
3972
3973         (WebKit::WebPage::touchEventSync):
3974         * WebProcess/WebPage/WebPage.h:
3975
3976         Add a new helper, sendSyncWithDelayedReply, to be used when sending a sync IPC message to the UI process that
3977         cannot be immediately completed upon arrival. Importantly, this cancels pending sync replies, and also passes
3978         IPC::SendSyncOption::InformPlatformProcessWillSuspend.
3979
3980         * WebProcess/WebPage/WebPage.messages.in:
3981
3982         Change these from LegacySync to Delayed messages.
3983
3984         * WebProcess/WebPage/ios/WebPageIOS.mm:
3985         (WebKit::WebPage::getPositionInformation):
3986
3987         Make this sync IPC handler (as well as WebPage::touchEventSync) store the IPC reply during the scope of the
3988         method, and invoke the stored reply at the end of the method if it wasn't interrupted due to something calling
3989         cancelGesturesBlockedOnSynchronousReplies().
3990
3991         (WebKit::WebPage::positionInformation):
3992
3993         Refactor getPositionInformation by pulling out the logic for building an InteractionInformationAtPosition into
3994         a separate helper.
3995
3996         (WebKit::WebPage::requestPositionInformation):
3997
3998 2019-02-01  David Quesada  <david_quesada@apple.com>
3999
4000         Network Process crash when resuming downloads: '-[__NSDictionaryI setObject:forKey:]: unrecognized selector sent to instance %p'
4001         https://bugs.webkit.org/show_bug.cgi?id=194144
4002         rdar://problem/47553456