[WebAuthn] Provide a _WKWebAuthenticationPanelUpdatePINInvalid update to UI clients...
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2020-06-19  Jiewen Tan  <jiewen_tan@apple.com>
2
3         [WebAuthn] Provide a _WKWebAuthenticationPanelUpdatePINInvalid update to UI clients if the returned PIN from the client is not valid
4         https://bugs.webkit.org/show_bug.cgi?id=213404
5         <rdar://problem/64543894>
6
7         Reviewed by Brent Fulgham.
8
9         Provide a _WKWebAuthenticationPanelUpdatePINInvalid update to UI clients if the returned PIN from the client is not valid such that clients can
10         reuse the same logic to handle invalid pin from the authenticator. This change makes their life easier.
11
12         Covered by API tests.
13
14         * UIProcess/API/APIWebAuthenticationPanelClient.h:
15         (API::WebAuthenticationPanelClient::requestPin const):
16         * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.mm:
17         (WebKit::WebAuthenticationPanelClient::requestPin const):
18         Now, only null strings are intepreted as cancels.
19
20         * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:
21         (WebKit::CtapAuthenticator::continueMakeCredentialAfterResponseReceived):
22         (WebKit::CtapAuthenticator::continueGetAssertionAfterResponseReceived):
23         (WebKit::CtapAuthenticator::continueGetPinTokenAfterRequestPin):
24         (WebKit::CtapAuthenticator::continueRequestAfterGetPinToken):
25         This patch also removes potential null pointer dereferences.
26
27 2020-06-19  Per Arne Vollan  <pvollan@apple.com>
28
29         [macOS] Connections to the preference daemon are established before entering the sandbox
30         https://bugs.webkit.org/show_bug.cgi?id=213379
31
32         Reviewed by Darin Adler.
33
34         On macOS, connections to the preference daemon are established before entering the sandbox. These connections also persist
35         after entering the sandbox and denying access to the preference daemon. There should not be attempts to connect to the
36         preference daemon before entering the sandbox, since these attempts will not be stopped by the sandbox. This patch moves
37         code that connects to the preference daemon to be executed after the sandbox has been entered. That includes code to
38         prevent connections to the Dock and code to initialize WebKit logging. Also, instead of calling [NSBundle bundleForClass:],
39         call [NSBundle bundleWithIdentifier:], since calling [NSBundle bundleForClass:] will connect to the preference daemon.
40         Finally, allow the syscall SYS_gethostuuid, since that is needed by CoreFoundation when there is no access to the
41         preference daemon.
42
43         No new tests. This should be covered by existing tests. It would be nice to have a test to make sure that there are no
44         connections to the preference daemon just before entering the sandbox, but I am not aware of how to implement this.
45
46         * NetworkProcess/mac/NetworkProcessMac.mm:
47         (WebKit::NetworkProcess::initializeSandbox):
48         * Shared/AuxiliaryProcess.cpp:
49         (WebKit::AuxiliaryProcess::initialize):
50         * Shared/Cocoa/WebKit2InitializeCocoa.mm:
51         (WebKit::runInitializationCode):
52         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
53         (WebKit::XPCServiceMain):
54         * Shared/mac/AuxiliaryProcessMac.mm:
55         (WebKit::webKit2Bundle):
56         * WebProcess/cocoa/WebProcessCocoa.mm:
57         (WebKit::WebProcess::platformInitializeWebProcess):
58         (WebKit::WebProcess::initializeSandbox):
59         * WebProcess/com.apple.WebProcess.sb.in:
60
61 2020-06-19  Chris Dumez  <cdumez@apple.com>
62
63         Avoid initializing RenderTheme singleton unnecessarily in the UIProcess
64         https://bugs.webkit.org/show_bug.cgi?id=213406
65
66         Reviewed by Per Arne Vollan.
67
68         Avoid initializing RenderTheme singleton unnecessarily in the UIProcess. Instead, introduce
69         a static function to get the focus ring color on iOS.
70
71         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
72         (WebKit::WebProcessPool::platformInitializeWebProcess):
73
74 2020-06-19  Chris Dumez  <cdumez@apple.com>
75
76         Unreviewed build fix after r263288.
77
78         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
79         (WebKit::WebProcessPool::platformInitializeWebProcess):
80
81 2020-06-19  Chris Dumez  <cdumez@apple.com>
82
83         Use ASCIILiteral more for SandboxExtension functions
84         https://bugs.webkit.org/show_bug.cgi?id=213400
85
86         Reviewed by Per Arne Vollan.
87
88         Use ASCIILiteral more for SandboxExtension functions. Functions like createHandleForMachLookup() / createHandleForIOKitClassExtension()
89         don't need to take in Strings, ASCIILiteral is enough.
90
91         * Shared/Cocoa/SandboxExtensionCocoa.mm:
92         (WebKit::createHandlesForResources):
93         (WebKit::SandboxExtension::createReadOnlyHandlesForFiles):
94         (WebKit::SandboxExtension::createHandleForGenericExtension):
95         (WebKit::SandboxExtension::createHandleForMachLookup):
96         (WebKit::SandboxExtension::createHandlesForMachLookup):
97         (WebKit::SandboxExtension::createHandleForIOKitClassExtension):
98         (WebKit::SandboxExtension::createHandlesForIOKitClassExtensions):
99         * Shared/SandboxExtension.h:
100         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
101         (WebKit::mediaRelatedMachServices):
102         (WebKit::nonBrowserServices):
103         (WebKit::diagnosticServices):
104         (WebKit::agxCompilerClasses):
105         (WebKit::WebProcessPool::platformInitializeWebProcess):
106         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
107         (WebKit::WebProcessProxy::enableRemoteInspectorIfNeeded):
108         * UIProcess/GPU/GPUProcessProxy.cpp:
109         (WebKit::GPUProcessProxy::singleton):
110         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
111         (WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest):
112         * UIProcess/WebPageProxy.cpp:
113         (WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
114         (WebKit::WebPageProxy::creationParameters):
115         * UIProcess/ios/WebPageProxyIOS.mm:
116         (WebKit::WebPageProxy::grantAccessToAssetServices):
117
118 2020-06-19  Brent Fulgham  <bfulgham@apple.com>
119
120         [iOS, macOS] Allow access to the container manager to support Mail InjectedBundle
121         https://bugs.webkit.org/show_bug.cgi?id=213357
122         <rdar://problem/63837247>
123
124         Reviewed by Darin Adler.
125
126         The Mail Injected Bundle requires access to the container manager to support certain OS operations. We do not need
127         this access for web browsing, and should limit this access to this one case.
128
129         This patch creates a dynamic mach extension to the container manager for this single use case. It also denies the
130         non-extension access case with a backtrace so we can see if any other clients are hitting this.
131
132         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
133         * Shared/WebProcessCreationParameters.cpp:
134         (WebKit::WebProcessCreationParameters::encode const):
135         (WebKit::WebProcessCreationParameters::decode):
136         * Shared/WebProcessCreationParameters.h:
137         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
138         (WebKit::WebProcessPool::platformInitializeWebProcess):
139         * WebProcess/cocoa/WebProcessCocoa.mm:
140         (WebKit::WebProcess::platformInitializeWebProcess):
141         * WebProcess/com.apple.WebProcess.sb.in:
142
143 2020-06-19  Andres Gonzalez  <andresg_22@apple.com>
144
145         AX: web process crash in AXObjectCache::postNotification.
146         https://bugs.webkit.org/show_bug.cgi?id=213398
147
148         Reviewed by Chris Fleizach.
149
150         AXObjectCache was being instantiated on the AX secondary thread.
151         Therefore the timers for the different delayed notifications where
152         initialized with the secondary thread. When postNotification was triggered
153         on the main thread as it should, and the timer was accessed, the timer
154         would assert/crash for being accessed in a thread different than where
155         it was created. This change guaranties that AXObjectCache is always
156         created on the main thread.
157
158         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
159         (-[WKAccessibilityWebPageObjectBase axObjectCache]):
160         (-[WKAccessibilityWebPageObjectBase accessibilityPluginObject]):
161         (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
162         (-[WKAccessibilityWebPageObjectBase setWebPage:]):
163         (-[WKAccessibilityWebPageObjectBase setHasMainFramePlugin:]):
164         (-[WKAccessibilityWebPageObjectBase setRemoteParent:]):
165
166 2020-06-19  Chris Fleizach  <cfleizach@apple.com>
167
168         AX: Make isolated tree enablement status dependent on client preference
169         https://bugs.webkit.org/show_bug.cgi?id=213355
170         <rdar://problem/64506577>
171
172         Reviewed by Zalan Bujtas.
173
174         We don't want the isolated tree mode in all clients (like Mail or Dictionary).
175         As a result, we can set this setting to off and allow safari and mini browser turn on more directly.
176
177         * Shared/WebPreferences.yaml:
178         * UIProcess/API/Cocoa/WKPreferences.mm:
179         (-[WKPreferences _setAccessibilityIsolatedTreeEnabled:]):
180         (-[WKPreferences _accessibilityIsolatedTreeEnabled]):
181         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
182         * WebProcess/InjectedBundle/InjectedBundle.cpp:
183         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
184         (WebKit::InjectedBundle::setAccessibilityIsolatedTreeEnabled):
185         * WebProcess/InjectedBundle/InjectedBundle.h:
186
187 2020-06-19  Rob Buis  <rbuis@igalia.com>
188
189         Enable referrer policy attribute support by default
190         https://bugs.webkit.org/show_bug.cgi?id=213285
191
192         Reviewed by Youenn Fablet.
193
194         Enable referrer policy attribute support by default by flipping the switch.
195
196         * Shared/WebPreferences.yaml:
197
198 2020-06-19  Youenn Fablet  <youenn@apple.com>
199
200         LibWebRTCSocketClient::sendTo is too verbose in case of error
201         https://bugs.webkit.org/show_bug.cgi?id=213380
202
203         Reviewed by Eric Carlson.
204
205         Only log error message if the error code is different from the previous one.
206
207         * NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
208         (WebKit::LibWebRTCSocketClient::sendTo):
209         * NetworkProcess/webrtc/LibWebRTCSocketClient.h:
210
211 2020-06-19  Chris Dumez  <cdumez@apple.com>
212
213         Web Inspector: RemoteInspector::singleton() slows down MobileSafari launch
214         https://bugs.webkit.org/show_bug.cgi?id=213381
215         <rdar://problem/64533003>
216
217         Reviewed by Darin Adler.
218
219         RemoteInspector::singleton() is expensive according to traces. It was called in WebProcessPool::initializeNewWebProcess()
220         which happens on MobileSafari launch because we prewarm a WebProcess. However, there is no reason to initialize remote
221         Web Inspector at this point. Per associated comment, Remote Web Inspector needs to be initialized once there is a
222         sub process hosting one of our Web View. As a result, I moved the initialization call to WebPageProxy::initializeWebPage()
223         which is when we actually send the IPC to the WebProcess to create the WebPage that is backing the UI-side WebView.
224
225         * UIProcess/WebPageProxy.cpp:
226         (WebKit::WebPageProxy::initializeWebPage):
227         * UIProcess/WebProcessPool.cpp:
228         (WebKit::WebProcessPool::initializeNewWebProcess):
229
230 2020-06-19  Chris Dumez  <cdumez@apple.com>
231
232         Move Prefixed WebAudio interfaces behind their own feature flag
233         https://bugs.webkit.org/show_bug.cgi?id=213356
234
235         Reviewed by Darin Adler.
236
237         * Shared/WebPreferences.yaml:
238
239 2020-06-19  Rob Buis  <rbuis@igalia.com>
240
241         Enable stale-while-revalidate support by default
242         https://bugs.webkit.org/show_bug.cgi?id=213286
243
244         Reviewed by Youenn Fablet.
245
246         Enable stale-while-revalidate support for Mac/GTK/WPE by changing the default
247         to true. Note that platforms that do not support speculative loads, which s-w-r
248         relies on, will not see any change in bahavior.
249
250         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
251
252 2020-06-19  Alexander Mikhaylenko  <alexm@gnome.org>
253
254         REGRESSION(r253360): [GTK] Page starts loading during animation in back/forward gesture
255         https://bugs.webkit.org/show_bug.cgi?id=205650
256
257         Reviewed by Carlos Garcia Campos.
258
259         r253360 changed the swipe gesture to start loading the page during the gesture, relying on
260         freezing the layer tree state to prevent unwanted redraws. However, it was implemented for
261         AC mode, but didn't prevent redraws in non-accelerated mode. Add a simple check to skip
262         redraws in this case.
263
264         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
265         (WebKit::DrawingAreaCoordinatedGraphics::display): Skip drawing if layer tree state is frozen.
266
267 2020-06-19  Carlos Garcia Campos  <cgarcia@igalia.com>
268
269         Add support for fetching registrable domains with resource load statistics
270         https://bugs.webkit.org/show_bug.cgi?id=213291
271
272         Reviewed by Adrian Perez de Castro and Youenn Fablet.
273
274         WebsiteDataStore::fetchData() doesn't return anything for resource load statistics because
275         NetworkProcess::fetchWebsiteData() doesn't handle WebsiteDataType::ResourceLoadStatistics.
276
277         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
278         (WebKit::ResourceLoadStatisticsDatabaseStore::allDomains const): Query all registrable domains from database.
279         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
280         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
281         (WebKit::ResourceLoadStatisticsMemoryStore::allDomains const): Return all registrable domains in memory map.
282         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
283         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
284         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
285         (WebKit::WebResourceLoadStatisticsStore::registrableDomains): Get the list of registrable domains.
286         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
287         * NetworkProcess/NetworkProcess.cpp:
288         (WebKit::NetworkProcess::fetchWebsiteData): Handle WebsiteDataType::ResourceLoadStatistics.
289         * Shared/WebsiteData/WebsiteData.cpp:
290         (WebKit::WebsiteData::encode const): Encode registrableDomainsWithResourceLoadStatistics.
291         (WebKit::WebsiteData::decode): Decode registrableDomainsWithResourceLoadStatistics.
292         * Shared/WebsiteData/WebsiteData.h:
293         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
294         (WKWebsiteDataStoreRemoveITPDataForDomain): Use WebsiteDataRecord::addResourceLoadStatisticsRegistrableDomain()
295         instead of the display name.
296         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
297         (WebKit::WebsiteDataRecord::addResourceLoadStatisticsRegistrableDomain): Add the given registrable domain to the list.
298         * UIProcess/WebsiteData/WebsiteDataRecord.h:
299         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
300         (WebKit::WebsiteDataStore::fetchDataAndApply): Handle registrable domains with resource load statistics.
301         (WebKit::WebsiteDataStore::removeData): Use resourceLoadStatisticsRegistrableDomains instead of the display name.
302
303 2020-06-18  David Kilzer  <ddkilzer@apple.com>
304
305         Use fastMalloc/fastFree in WebCoreArgumentCodersMac.mm
306         <https://webkit.org/b/213325>
307
308         Reviewed by Darin Adler.
309
310         * Shared/mac/WebCoreArgumentCodersMac.mm:
311         (IPC::createArchiveList):
312         (IPC::createCFURLRequestFromSerializableRepresentation):
313
314 2020-06-18  Tim Horton  <timothy_horton@apple.com>
315
316         Remove some vestiges of the 32-bit Plugin Process
317         https://bugs.webkit.org/show_bug.cgi?id=213361
318
319         Reviewed by Dan Bernstein.
320
321         We haven't launched 32-bit plugins for a while, but there are some
322         build system complications and random references in the code that we can get rid of.
323
324         * WebKit.xcodeproj/project.pbxproj:
325         * Configurations/PluginService.xcconfig: Renamed from Source/WebKit/Configurations/PluginService.64.xcconfig.
326         No need for .64 in the name anymore, since it's the only one.
327         We do have to leave the .64 in the product name because there are other things in the system that depend on this.
328
329         * PluginProcess/EntryPoint/Cocoa/XPCService/PluginService.Info.plist: Renamed from Source/WebKit/PluginProcess/EntryPoint/Cocoa/XPCService/PluginService.64.Info.plist.
330         No need for .64 in the name anymore.
331
332         * UIProcess/AuxiliaryProcessProxy.cpp:
333         (WebKit::AuxiliaryProcessProxy::getLaunchOptions):
334         * UIProcess/Launcher/ProcessLauncher.h:
335         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
336         (WebKit::serviceName):
337         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
338         (WebKit::PluginProcessProxy::platformGetLaunchOptionsWithAttributes):
339         There need only be one ProcessType for the plugin process now!
340
341         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
342         (WebKit::PluginProcessProxy::platformGetLaunchOptionsWithAttributes):
343         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
344         (WebKit::bubblewrapSpawn):
345         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
346         (WebKit::ProcessLauncher::launchProcess):
347         GTK WebKit appears to also only launch 64-bit plugin processes.
348
349 2020-06-18  Megan Gardner  <megan_gardner@apple.com>
350
351         Workaround for UIKit layout bug in time picker.
352         https://bugs.webkit.org/show_bug.cgi?id=213346
353         <rdar://problem/64042277>
354
355         Reviewed by Tim Horton.
356
357         There is a bug in the layout of UIKit that needs to be fixed.
358         Until then, this workaround should give us a view that is viable.
359
360         * UIProcess/ios/WKContentViewInteraction.mm:
361         (-[WKContentView resignFirstResponderForWebView]):
362         * UIProcess/ios/forms/WKDateTimeInputControl.mm:
363         (-[WKDateTimeContextMenuViewController preferredContentSize]):
364
365 2020-06-18  David Kilzer  <ddkilzer@apple.com>
366
367         [IPC hardening] OptionSet<> values should be validated
368         <https://webkit.org/b/213199>
369         <rdar://problem/64369963>
370
371         Reviewed by Anders Carlsson.
372
373         Summary:
374         - Add WTF::EnumTraits<> for all OptionSet<> enums.
375         - Specify unsigned backing types for enum classes.
376
377         * NetworkProcess/NetworkProcess.h:
378         * NetworkProcess/NetworkSession.h:
379         * Platform/IPC/ArgumentCoders.h:
380         (IPC::ArgumentCoder<OptionSet<T>>::encode):
381         (IPC::ArgumentCoder<OptionSet<T>>::decode):
382         - Add WTF::isValidOptionSet() checks.
383         * Platform/IPC/Decoder.h:
384         * Platform/IPC/Encoder.h:
385         - Replace <wtf/EnumTraits.h> with <wtf/OptionSet.h> since the
386           latter now includes the former.
387         * Platform/IPC/MessageFlags.h:
388         * Shared/DocumentEditingContext.h:
389         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
390         * Shared/WebEvent.h:
391         * Shared/WebsiteAutoplayQuirk.h:
392         * Shared/WebsiteData/WebsiteData.h:
393         * Shared/WebsiteData/WebsiteDataFetchOption.h:
394         * Shared/WebsiteData/WebsiteDataType.h:
395         * Shared/ios/GestureTypes.h:
396         * UIProcess/Network/NetworkProcessProxy.h:
397         * UIProcess/Plugins/PluginProcessManager.h:
398         * UIProcess/WebProcessProxy.h:
399         * UIProcess/WebsiteData/WebsiteDataStore.h:
400         * WebProcess/WebProcess.h:
401
402 2020-06-18  Carlos Garcia Campos  <cgarcia@igalia.com>
403
404         [GTK][WPE] Add API to configure and handle service worker registrations to WebKitWebsiteDataManager
405         https://bugs.webkit.org/show_bug.cgi?id=213290
406
407         Reviewed by Michael Catanzaro.
408
409         The default path is always used even for apps setting a base data directory. We should handle
410         WebsiteDataType::ServiceWorkerRegistrations to configure the directory and allow to fetch and clear them.
411
412         * UIProcess/API/glib/WebKitWebsiteData.cpp:
413         (recordContainsSupportedDataTypes):
414         (toWebKitWebsiteDataTypes):
415         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
416         (webkitWebsiteDataManagerGetProperty):
417         (webkitWebsiteDataManagerSetProperty):
418         (webkitWebsiteDataManagerConstructed):
419         (webkit_website_data_manager_class_init):
420         (webkitWebsiteDataManagerGetDataStore):
421         (webkit_website_data_manager_get_service_worker_registrations_directory):
422         (toWebsiteDataTypes):
423         * UIProcess/API/gtk/WebKitWebsiteData.h:
424         * UIProcess/API/gtk/WebKitWebsiteDataManager.h:
425         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
426         * UIProcess/API/wpe/WebKitWebsiteData.h:
427         * UIProcess/API/wpe/WebKitWebsiteDataManager.h:
428         * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:
429
430 2020-06-18  Yuri Chornoivan  <yurchor@ukr.net>
431
432         Unreviewed. Fix a typo introduced in r263085
433
434         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
435         (webkit_website_data_manager_class_init):
436
437 2020-06-17  Chris Dumez  <cdumez@apple.com>
438
439         Add experimental feature flag for modern & unprefixed WebAudio API
440         https://bugs.webkit.org/show_bug.cgi?id=213268
441
442         Reviewed by Jer Noble.
443
444         Add experimental feature flag for modern & unprefixed WebAudio API,
445         off by default.
446
447         * Shared/WebPreferences.yaml:
448
449 2020-06-17  Wenson Hsieh  <wenson_hsieh@apple.com>
450
451         [macOS] Shift-tab in a bullet list in Mail Compose jumps back to Subject field
452         https://bugs.webkit.org/show_bug.cgi?id=213320
453         <rdar://problem/63831962>
454
455         Reviewed by Tim Horton.
456
457         See WebCore/ChangeLog for more detail.
458
459         * WebProcess/WebPage/WebPage.cpp:
460         (WebKit::WebPage::handleKeyEventByRelinquishingFocusToChrome):
461         * WebProcess/WebPage/WebPage.h:
462         * WebProcess/WebPage/ios/WebPageIOS.mm:
463         (WebKit::WebPage::handleEditingKeyboardEvent):
464
465         Hoist logic for relinquishing focus as a result of shift+tab from EventHandler to WebPage, so that it is the
466         default behavior when processing a "keypress" event that corresponds to shift+tab in an editable web view on
467         Cocoa platforms. If we do end up relinquishing focus, then we consider the keypress event to be handled.
468
469         * WebProcess/WebPage/mac/WebPageMac.mm:
470         (WebKit::WebPage::handleEditingKeyboardEvent):
471
472 2020-06-17  Beth Dakin  <bdakin@apple.com>
473
474         Remove references to blacklist/whitelist in the old C API
475         https://bugs.webkit.org/show_bug.cgi?id=213322
476
477         Reviewed by Tim Horton.
478
479         * UIProcess/API/C/WKPageGroup.cpp:
480         (WKPageGroupAddUserStyleSheet):
481         (WKPageGroupAddUserScript):
482         * UIProcess/API/C/WKPageGroup.h:
483         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
484
485 2020-06-17  Alex Christensen  <achristensen@webkit.org>
486
487         Null check plugin.m_data before using it in PDFPlugin::ByteRangeRequest::completeUnconditionally
488         https://bugs.webkit.org/show_bug.cgi?id=213305
489         <rdar://problem/60349279>
490
491         Reviewed by Brady Eidson.
492
493         * WebProcess/Plugins/PDF/PDFPlugin.mm:
494         (WebKit::PDFPlugin::ByteRangeRequest::completeUnconditionally):
495
496 2020-06-17  Darryl Pogue  <darryl@dpogue.ca>
497
498         IndexedDB: Support IDBFactory databases method
499         https://bugs.webkit.org/show_bug.cgi?id=211043
500
501         Reviewed by Youenn Fablet.
502
503         Plumbing for returning a list of IDB databases and versions.
504
505         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
506         (WebKit::WebIDBConnectionToClient::didGetAllDatabaseNamesAndVersions):
507         (WebKit::WebIDBConnectionToClient::didGetAllDatabaseNames): Deleted.
508         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
509         * NetworkProcess/IndexedDB/WebIDBServer.cpp:
510         (WebKit::WebIDBServer::getAllDatabaseNamesAndVersions):
511         (WebKit::WebIDBServer::getAllDatabaseNames): Deleted.
512         * NetworkProcess/IndexedDB/WebIDBServer.h:
513         * NetworkProcess/IndexedDB/WebIDBServer.messages.in:
514         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
515         (WebKit::WebIDBConnectionToServer::getAllDatabaseNamesAndVersions):
516         (WebKit::WebIDBConnectionToServer::didGetAllDatabaseNamesAndVersions):
517         (WebKit::WebIDBConnectionToServer::getAllDatabaseNames): Deleted.
518         (WebKit::WebIDBConnectionToServer::didGetAllDatabaseNames): Deleted.
519         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
520         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
521
522 2020-06-16  Simon Fraser  <simon.fraser@apple.com>
523
524         REGRESSION (r255037): Broken position while comparing watch bands on www.apple.com/shop/studio/apple-watch
525         https://bugs.webkit.org/show_bug.cgi?id=213282
526         <rdar://problem/63862940>
527
528         Reviewed by Antti Koivisto.
529
530         If a scrolling tree commit has a requested scroll position update for a node, we need
531         to call applyLayerPositons() to set the UIScrollView's contentOffset.
532
533         Often the layer tree commit will contain a boundsOrigin change for the layer in question
534         (which is equivalent to setting the UIScrollView's contentOffset), but some combinations of
535         user and programmatic scrolling result in no boundsOrigin change, revealing the bug.
536
537         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
538         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):
539
540 2020-06-16  Kate Cheney  <katherine_cheney@apple.com>
541
542         Check for inAppBrowserPrivacyEnabled flag in WebsiteDataStore::initializeAppBoundDomains is expensive and calls a non-static function WebsiteDataStore::parameters().
543         https://bugs.webkit.org/show_bug.cgi?id=213261
544         <rdar://problem/64317084>
545
546         Reviewed by Brent Fulgham.
547
548         There are two bugs here. First, WebsiteDataStore::parameters()
549         does a lot of work aside from returning the parameters, making this an
550         expensive call just to check the value of one flag. Second,
551         appBoundDomains() is a static hashset, and initializing the hashset
552         should not rely on non-static functions.
553
554         * NetworkProcess/NetworkSessionCreationParameters.cpp:
555         (WebKit::NetworkSessionCreationParameters::encode const):
556         (WebKit::NetworkSessionCreationParameters::decode):
557         * NetworkProcess/NetworkSessionCreationParameters.h:
558         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
559         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
560         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
561         Remove flag, it is no longer used here.
562
563         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
564         (WebKit::WebsiteDataStore::platformSetNetworkParameters):
565         Save the flag value in a member variable so we can use that later
566         when checking app-bound domains. Rename to something more descriptive.
567
568         (WebKit::WebsiteDataStore::initializeAppBoundDomains):
569         Remove the check for the non-static runtime flag.
570
571         (WebKit::WebsiteDataStore::ensureAppBoundDomains const):
572         Enable test mode quirks. We must do it in two places in case the
573         initialization hasn't happened by the time we call
574         ensureAppBoundDomains.
575
576         * UIProcess/WebsiteData/WebsiteDataStore.h:
577
578 2020-06-16  Mark Lam  <mark.lam@apple.com>
579
580         Make Options::useJIT() be the canonical source of truth on whether we should use the JIT.
581         https://bugs.webkit.org/show_bug.cgi?id=212556
582         <rdar://problem/63780436>
583
584         Reviewed by Saam Barati.
585
586         * WebProcess/WebProcess.cpp:
587         (WebKit::WebProcess::isJITEnabled):
588
589 2020-06-16  David Kilzer  <ddkilzer@apple.com>
590
591         REGRESSION (r262994): Web Inspector is killed when context-clicking anywhere
592         <https://webkit.org/b/213224>
593         <rdar://problem/64383320>
594
595         Reviewed by Darin Adler.
596
597         * Platform/IPC/Decoder.h:
598         * Platform/IPC/Encoder.h:
599         - Include <WebCore/ContextMenuItem.h> since the definition of
600           the custom WTF::isValidEnum<WebCore::ContextMenuAction>
601           function is needed.
602         * Scripts/webkit/messages.py:
603         (generate_message_names_header):
604         - Change the third typename in the template for
605           WTF::isValidEnum<IPC::MessageName>() to avoid partial template
606           specialization errors from other implementations like
607           WTF::isValidEnum<WebCore::ContextMenuAction>().
608         - Also replace hard-coded "IPC::MessageName" names with template
609           values.
610
611 2020-06-16  Chris Dumez  <cdumez@apple.com>
612
613         Stop calling userPreferredLanguages() in the UIProcess
614         https://bugs.webkit.org/show_bug.cgi?id=213214
615         <rdar://problem/64317593>
616
617         Reviewed by Darin Adler.
618
619         Follow-up to r263094 to address post-landing feedback from Darin.
620         Use makeVector() functionality in WTF to convert the NSArray into a Vector instead
621         of doing it by hand. Also mark the NeverDestroyed variable as static const to
622         avoid leaking.
623
624         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
625         (WebKit::WebProcessProxy::platformOverrideLanguages const):
626
627 2020-06-16  Alex Christensen  <achristensen@webkit.org>
628
629         Provide alternatively-named WKBrowsingContextGroup SPI
630         https://bugs.webkit.org/show_bug.cgi?id=213229
631
632         Reviewed by Tim Horton.
633
634         This is unfortunately still used. In order to try to convince the user to make the smallest change possible, make newly named SPI that behaves identically.
635         Doubly-deprecate the old SPI and implement it in terms of the new during the transition period.
636
637         * UIProcess/API/Cocoa/WKBrowsingContextGroup.h:
638         * UIProcess/API/Cocoa/WKBrowsingContextGroup.mm:
639         (-[WKBrowsingContextGroup addUserStyleSheet:baseURL:whitelistedURLPatterns:blacklistedURLPatterns:mainFrameOnly:]):
640         (-[WKBrowsingContextGroup addUserStyleSheet:baseURL:includeMatchPatternStrings:excludeMatchPatternStrings:mainFrameOnly:]):
641         (-[WKBrowsingContextGroup addUserScript:baseURL:whitelistedURLPatterns:blacklistedURLPatterns:injectionTime:mainFrameOnly:]):
642         (-[WKBrowsingContextGroup addUserScript:baseURL:includeMatchPatternStrings:excludeMatchPatternStrings:injectionTime:mainFrameOnly:]):
643
644 2020-06-16  Youenn Fablet  <youenn@apple.com>
645
646         Loads triggered by an opaque stylesheet should not be visible to service workers
647         https://bugs.webkit.org/show_bug.cgi?id=213246
648
649         Reviewed by Alex Christensen.
650
651         * WebProcess/Network/WebLoaderStrategy.cpp:
652         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
653         In case the load is triggered from an opaque response, set service worker mode to none.
654
655 2020-06-16  Charlie Turner  <cturner@igalia.com>
656
657         [GTK] Disable video autoplay
658         https://bugs.webkit.org/show_bug.cgi?id=184845
659
660         Reviewed by Carlos Garcia Campos.
661
662         * PlatformGTK.cmake: Add new source files to the build.
663         * PlatformWPE.cmake: Ditto.
664         * SourcesGTK.txt: Ditto.
665         * SourcesWPE.txt: Ditto.
666         * UIProcess/API/glib/WebKitPolicyDecision.cpp:
667         (webkit_policy_decision_use_with_policies): : Add an API to
668         respond to navigation decisions with policies.
669         * UIProcess/API/glib/WebKitWebContext.cpp:
670         (webkitWebContextCreatePageForWebView): Plumb in the default
671         website policies that are associated with the web view.
672         * UIProcess/API/glib/WebKitWebContextPrivate.h:
673         * UIProcess/API/glib/WebKitWebView.cpp:
674         (webkitWebViewConstructed):
675         (webkitWebViewSetProperty):
676         (webkitWebViewGetProperty):
677         (webkit_web_view_class_init):
678         (webkit_web_view_get_website_policies):
679         * UIProcess/API/glib/WebKitWebsitePolicies.cpp: Added.
680         (_WebKitWebsitePoliciesPrivate::_WebKitWebsitePoliciesPrivate):
681         (webkitWebsitePoliciesGetWebsitePolicies):
682         (webkitWebsitePoliciesGetPoliciesData):
683         (webkitWebsitePoliciesGetProperty):
684         (webkitWebsitePoliciesSetAutoplayPolicy):
685         (webkitWebsitePoliciesSetProperty):
686         (webkit_website_policies_class_init):
687         (webkit_website_policies_new):
688         (webkit_website_policies_new_with_policies):
689         (webkit_website_policies_get_autoplay_policy):
690         * UIProcess/API/glib/WebKitWebsitePoliciesPrivate.h: Added.
691         * UIProcess/API/gtk/WebKitPolicyDecision.h:
692         * UIProcess/API/gtk/WebKitWebView.h:
693         * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
694         (webkit_web_view_new_with_related_view):
695         * UIProcess/API/gtk/WebKitWebsitePolicies.h: Added.
696         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
697         * UIProcess/API/wpe/WebKitPolicyDecision.h:
698         * UIProcess/API/wpe/WebKitWebView.h:
699         * UIProcess/API/wpe/WebKitWebsitePolicies.h: Added.
700         * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:
701
702 2020-06-16  Chris Dumez  <cdumez@apple.com>
703
704         Stop calling userPreferredLanguages() in the UIProcess
705         https://bugs.webkit.org/show_bug.cgi?id=213214
706         <rdar://problem/64317593>
707
708         Reviewed by Per Arne Vollan.
709
710         Stop calling userPreferredLanguages() in the UIProcess since this can be slow and may keep
711         the main thread busy. Nowadays, the WebProcess is able to call it by itself anyway. The
712         sandbox is allowing it.
713
714         * Shared/WebProcessCreationParameters.cpp:
715         (WebKit::WebProcessCreationParameters::encode const):
716         (WebKit::WebProcessCreationParameters::decode):
717         * Shared/WebProcessCreationParameters.h:
718         * UIProcess/WebProcessPool.cpp:
719         (WebKit::WebProcessPool::languageChanged):
720         (WebKit::WebProcessPool::initializeNewWebProcess):
721         * WebProcess/WebProcess.cpp:
722         (WebKit::WebProcess::initializeWebProcess):
723         (WebKit::WebProcess::userPreferredLanguagesChanged const):
724         * WebProcess/WebProcess.h:
725         * WebProcess/WebProcess.messages.in:
726
727 2020-06-16  Truitt Savell  <tsavell@apple.com>
728
729         Unreviewed, reverting r263079.
730
731         Broke Internal builds.
732
733         Reverted changeset:
734
735         "IndexedDB: Support IDBFactory databases method"
736         https://bugs.webkit.org/show_bug.cgi?id=211043
737         https://trac.webkit.org/changeset/263079
738
739 2020-06-16  Carlos Garcia Campos  <cgarcia@igalia.com>
740
741         [GTK][WPE] Add API to configure and enable resource load statistics
742         https://bugs.webkit.org/show_bug.cgi?id=177943
743
744         Reviewed by Michael Catanzaro.
745
746         * UIProcess/API/glib/WebKitWebsiteData.cpp:
747         (recordContainsSupportedDataTypes):
748         (toWebKitWebsiteDataTypes):
749         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
750         (webkitWebsiteDataManagerGetProperty):
751         (webkitWebsiteDataManagerSetProperty):
752         (webkitWebsiteDataManagerConstructed):
753         (webkit_website_data_manager_class_init):
754         (webkitWebsiteDataManagerGetDataStore):
755         (webkit_website_data_manager_get_itp_directory):
756         (webkit_website_data_manager_set_itp_enabled):
757         (webkit_website_data_manager_get_itp_enabled):
758         (toWebsiteDataTypes):
759         * UIProcess/API/gtk/WebKitWebsiteData.h:
760         * UIProcess/API/gtk/WebKitWebsiteDataManager.h:
761         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
762         * UIProcess/API/wpe/WebKitWebsiteData.h:
763         * UIProcess/API/wpe/WebKitWebsiteDataManager.h:
764         * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:
765         * UIProcess/glib/WebsiteDataStoreGLib.cpp:
766         (WebKit::WebsiteDataStore::defaultResourceLoadStatisticsDirectory):
767
768 2020-06-16  Darryl Pogue  <darryl@dpogue.ca>
769
770         IndexedDB: Support IDBFactory databases method
771         https://bugs.webkit.org/show_bug.cgi?id=211043
772
773         Reviewed by Youenn Fablet.
774
775         Plumbing for returning a list of IDB databases and versions.
776
777         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
778         (WebKit::WebIDBConnectionToClient::didGetAllDatabaseNamesAndVersions):
779         (WebKit::WebIDBConnectionToClient::didGetAllDatabaseNames): Deleted.
780         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
781         * NetworkProcess/IndexedDB/WebIDBServer.cpp:
782         (WebKit::WebIDBServer::getAllDatabaseNamesAndVersions):
783         (WebKit::WebIDBServer::getAllDatabaseNames): Deleted.
784         * NetworkProcess/IndexedDB/WebIDBServer.h:
785         * NetworkProcess/IndexedDB/WebIDBServer.messages.in:
786         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
787         (WebKit::WebIDBConnectionToServer::getAllDatabaseNamesAndVersions):
788         (WebKit::WebIDBConnectionToServer::didGetAllDatabaseNamesAndVersions):
789         (WebKit::WebIDBConnectionToServer::getAllDatabaseNames): Deleted.
790         (WebKit::WebIDBConnectionToServer::didGetAllDatabaseNames): Deleted.
791         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
792         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
793
794 2020-06-15  Pavel Feldman  <pavel.feldman@gmail.com>
795
796         Web Inspector: introduce request interception
797         https://bugs.webkit.org/show_bug.cgi?id=207446
798
799         Reviewed by Devin Rousso.
800
801         This change introduces network request interception to the Network 
802         protocol domain. It adds Network.interceptWithRequest notification that
803         can be continued, modified or fulfilled. NetworkStage enum can now have
804         'request' and 'response' values.
805
806         * WebProcess/Network/WebLoaderStrategy.cpp:
807         (WebKit::WebLoaderStrategy::scheduleLoad):
808
809 2020-06-15  Brent Fulgham  <bfulgham@apple.com>
810
811         [macOS] Update sandboxes to reduce logging for media-related operations
812         https://bugs.webkit.org/show_bug.cgi?id=213210
813         <rdar://problem/64376237>
814
815         Reviewed by Per Arne Vollan.
816
817         Ongoing testing has uncovered a set of additional services and IOKit
818         properties that we should allow without logging.
819
820         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
821         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
822         (WebKit::mediaRelatedMachServices):
823         * WebProcess/com.apple.WebProcess.sb.in:
824
825 2020-06-15  Alex Christensen  <achristensen@webkit.org>
826
827         Provide alternatively-named SPI for user style sheets and scripts
828         https://bugs.webkit.org/show_bug.cgi?id=213206
829
830         Reviewed by Brady Eidson.
831
832         Test-only SPI was just renamed.
833         SPI used by other projects was deprecated with a replacement so we can remove the old names soon.
834
835         _WKUserContentWorld/WKContentWorld was tied up in this, and rather than provide replacement SPI with deprecated _WKUserContentWorld,
836         this will move some SPI from _WKUserContentWorld to WKContentWorld too.  The most heavy user of _WKUserContentWorld is TestWebKitAPI and we'll remove it soon.
837
838         * UIProcess/API/C/WKContext.cpp:
839         (WKContextSetFontAllowList):
840         (WKContextSetFontWhitelist): Deleted.
841         * UIProcess/API/C/WKContextPrivate.h:
842         * UIProcess/API/Cocoa/WKUserContentController.mm:
843         (-[WKUserContentController _removeAllUserScriptsAssociatedWithContentWorld:]):
844         (-[WKUserContentController _removeAllUserStyleSheetsAssociatedWithContentWorld:]):
845         (-[WKUserContentController _addScriptMessageHandler:name:contentWorld:]):
846         (-[WKUserContentController _removeAllUserScriptsAssociatedWithUserContentWorld:]): Deleted.
847         (-[WKUserContentController _removeAllUserStyleSheetsAssociatedWithUserContentWorld:]): Deleted.
848         * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
849         * UIProcess/API/Cocoa/WKUserScript.mm:
850         (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:includeMatchPatternStrings:excludeMatchPatternStrings:associatedURL:contentWorld:deferRunningUntilNotification:]):
851         * UIProcess/API/Cocoa/WKUserScriptPrivate.h:
852         * UIProcess/API/Cocoa/_WKUserStyleSheet.h:
853         * UIProcess/API/Cocoa/_WKUserStyleSheet.mm:
854         (-[_WKUserStyleSheet initWithSource:forWKWebView:forMainFrameOnly:includeMatchPatternStrings:excludeMatchPatternStrings:baseURL:level:contentWorld:]):
855         * UIProcess/WebProcessPool.cpp:
856         (WebKit::WebProcessPool::setFontAllowList):
857         (WebKit::WebProcessPool::setFontWhitelist): Deleted.
858         * UIProcess/WebProcessPool.h:
859
860 2020-06-15  Alex Christensen  <achristensen@webkit.org>
861
862         Add SPI to preconnect to a server
863         https://bugs.webkit.org/show_bug.cgi?id=213109
864         <rdar://problem/64184412>
865
866         Reviewed by Geoff Garen.
867
868         Covered by API tests.
869
870         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
871         * UIProcess/API/Cocoa/WKWebView.mm:
872         (-[WKWebView _preconnectToServer:]):
873         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
874         * UIProcess/Network/NetworkProcessProxy.cpp:
875         (WebKit::NetworkProcessProxy::preconnectTo):
876         * UIProcess/WebPageProxy.cpp:
877         (WebKit::WebPageProxy::preconnectTo):
878         * UIProcess/WebPageProxy.h:
879
880 2020-06-15  Keith Miller  <keith_miller@apple.com>
881
882         Signal handlers should have a two phase installation.
883         https://bugs.webkit.org/show_bug.cgi?id=213160
884
885         Reviewed by Mark Lam.
886
887         Put back old WASM fast memory installation.
888
889         * WebProcess/WebProcess.cpp:
890         (WebKit::WebProcess::initializeWebProcess):
891
892 2020-06-15  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
893
894         Suppress compiler warnings
895         https://bugs.webkit.org/show_bug.cgi?id=213034
896
897         Reviewed by Darin Adler.
898
899         Convert to std:size_t to compare equal data types.
900
901         * NetworkProcess/cache/NetworkCacheData.cpp:
902         (WebKit::NetworkCache::readOrMakeSalt):
903
904 2020-06-15  Chris Dumez  <cdumez@apple.com>
905
906         Revert r260856 as it seems to have regressed PLT on iOS
907         https://bugs.webkit.org/show_bug.cgi?id=213194
908         <rdar://problem/64331458>
909
910         Unreviewed, revert r260856 due to regression.
911
912         * NetworkProcess/NetworkProcess.cpp:
913         (WebKit::NetworkProcess::NetworkProcess):
914         (WebKit::NetworkProcess::prepareToSuspend):
915         (WebKit::NetworkProcess::resume):
916         * NetworkProcess/NetworkProcess.h:
917         * Shared/WebSQLiteDatabaseTracker.cpp: Added.
918         (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
919         (WebKit::WebSQLiteDatabaseTracker::~WebSQLiteDatabaseTracker):
920         (WebKit::WebSQLiteDatabaseTracker::setIsSuspended):
921         (WebKit::WebSQLiteDatabaseTracker::willBeginFirstTransaction):
922         (WebKit::WebSQLiteDatabaseTracker::didFinishLastTransaction):
923         (WebKit::WebSQLiteDatabaseTracker::setIsHoldingLockedFiles):
924         * Shared/WebSQLiteDatabaseTracker.h: Added.
925         * SourcesCocoa.txt:
926         * UIProcess/Network/NetworkProcessProxy.cpp:
927         (WebKit::NetworkProcessProxy::didClose):
928         (WebKit::NetworkProcessProxy::setIsHoldingLockedFiles):
929         * UIProcess/Network/NetworkProcessProxy.h:
930         * UIProcess/Network/NetworkProcessProxy.messages.in:
931         * UIProcess/WebProcessProxy.cpp:
932         (WebKit::WebProcessProxy::shutDown):
933         (WebKit::WebProcessProxy::setIsHoldingLockedFiles):
934         * UIProcess/WebProcessProxy.h:
935         * UIProcess/WebProcessProxy.messages.in:
936         * WebKit.xcodeproj/project.pbxproj:
937         * WebProcess/WebProcess.cpp:
938         (WebKit::m_webSQLiteDatabaseTracker):
939         (WebKit::WebProcess::prepareToSuspend):
940         (WebKit::WebProcess::processDidResume):
941         * WebProcess/WebProcess.h:
942
943 2020-06-15  Carlos Garcia Campos  <cgarcia@igalia.com>
944
945         [GTK][WPE] Add API to expose UIClient::requestStorageAccessConfirm
946         https://bugs.webkit.org/show_bug.cgi?id=210422
947
948         Reviewed by Michael Catanzaro.
949
950         Add WebKitWebsiteDataAccessPermissionRequest to ask for permission to the user using the existing permission
951         request API.
952
953         * PlatformGTK.cmake:
954         * PlatformWPE.cmake:
955         * SourcesGTK.txt:
956         * SourcesWPE.txt:
957         * UIProcess/API/glib/WebKitUIClient.cpp:
958         * UIProcess/API/glib/WebKitWebsiteDataAccessPermissionRequest.cpp: Added.
959         (webkitWebsiteDataAccessPermissionRequestAllow):
960         (webkitWebsiteDataAccessPermissionRequestDeny):
961         (webkit_permission_request_interface_init):
962         (webkitWebsiteDataAccessPermissionRequestDispose):
963         (webkit_website_data_access_permission_request_class_init):
964         (webkitWebsiteDataAccessPermissionRequestCreate):
965         (webkit_website_data_access_permission_request_get_requesting_domain):
966         (webkit_website_data_access_permission_request_get_current_domain):
967         * UIProcess/API/glib/WebKitWebsiteDataAccessPermissionRequestPrivate.h: Added.
968         * UIProcess/API/gtk/WebKitWebsiteDataAccessPermissionRequest.h: Added.
969         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
970         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
971         * UIProcess/API/gtk/webkit2.h:
972         * UIProcess/API/wpe/WebKitWebsiteDataAccessPermissionRequest.h: Added.
973         * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:
974         * UIProcess/API/wpe/docs/wpe-docs.sgml:
975         * UIProcess/API/wpe/webkit.h:
976
977 2020-06-14  Sam Weinig  <weinig@apple.com>
978
979         [WPT] html/webappapis/system-state-and-capabilities/the-navigator-object/navigator-pluginarray.html fails due to lack of caching of Plugin objects
980         https://bugs.webkit.org/show_bug.cgi?id=213185
981
982         Reviewed by Darin Adler.
983
984         * UIProcess/Plugins/PluginInfoStore.h:
985         Add missing #include that is now needed due to pruning of unnecessary #includes
986         in WebCore.
987
988         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
989         (WebKit::pluginSupportsExtension):
990         Update to use new webVisibleMimeTypes() rather than the clunky getWebVisibleMimesAndPluginIndices().
991
992 2020-06-14  David Kilzer  <ddkilzer@apple.com>
993
994         [IPC hardening] Return type of -[NSCoder validateClassSupportsSecureCoding:] is incorrect
995         <https://webkit.org/b/213161>
996         <rdar://problem/64050085>
997
998         Reviewed by Darin Adler.
999
1000         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
1001         (validateClass):
1002         - Fix return type of
1003           -[NSCoder validateClassSupportsSecureCoding:].  Throw an
1004           NSException in case the method ever returns NO without
1005           throwing its own NSException.  (Currently this method does
1006           throw an NSException instead of returning NO.)
1007
1008 2020-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1009
1010         [SOUP] Disable HSTS for requests when cookies will be blocked by ITP
1011         https://bugs.webkit.org/show_bug.cgi?id=210739
1012
1013         Reviewed by Michael Catanzaro.
1014
1015         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1016         (WebKit::NetworkDataTaskSoup::shouldAllowHSTSProtocolUpgrade const):
1017
1018 2020-06-13  Richard Houle  <rhoule@apple.com>
1019
1020         Fix Overrelease in makeFailureSetForAllTextManipulationItems
1021         https://bugs.webkit.org/show_bug.cgi?id=213165
1022         <rdar://problem/61389164>
1023
1024         Reviewed by Wenson Hsieh.
1025
1026         * UIProcess/API/Cocoa/WKWebView.mm:
1027         (makeFailureSetForAllTextManipulationItems):
1028
1029 2020-06-13  Wenson Hsieh  <wenson_hsieh@apple.com>
1030
1031         [Mac Catalyst] Color inputs and selects fail to display popovers when clicked
1032         https://bugs.webkit.org/show_bug.cgi?id=213157
1033         <rdar://problem/64004135>
1034
1035         Reviewed by Tim Horton.
1036
1037         In Mac Catalyst, presenting popovers using `UIPopoverController` causes the first responder to change. This
1038         means that the WKContentView will resign first responder, which in turn causes the currently presented popover
1039         to be dismissed. This means that popovers for color inputs and select elements will be dismissed immediately
1040         after presentation.
1041
1042         To mitigate this, adapt the approach taken in r259840 to `WKColorPopover` and `WKSelectPopover` by teaching the
1043         base class (`WKRotatingPopover`) to temporarily preserve the focused element in light of first responder changes
1044         while presenting a popover on Mac Catalyst.
1045
1046         * UIProcess/ios/forms/WKFormPopover.mm:
1047         (-[WKRotatingPopover presentPopoverAnimated:]):
1048         (-[WKRotatingPopover dismissPopoverAnimated:]):
1049
1050 2020-06-13  Sam Weinig  <weinig@apple.com>
1051
1052         Extended Color: Experiment with strongly typed ColorComponents
1053         https://bugs.webkit.org/show_bug.cgi?id=212396
1054
1055         Reviewed by Darin Adler.
1056
1057         * UIProcess/API/wpe/WebKitColor.cpp:
1058         (webkitColorFillFromWebCoreColor):
1059         * UIProcess/gtk/ViewGestureControllerGtk.cpp:
1060         (WebKit::ViewGestureController::beginSwipeGesture):
1061         * WebProcess/WebPage/WebFrame.cpp:
1062         (WebKit::WebFrame::getDocumentBackgroundColor):
1063         Update to call toSRGBALossy() rather than toSRGBAComponentsLossy().
1064
1065 2020-06-13  Tetsuharu Ohzeki  <tetsuharu.ohzeki@gmail.com>
1066
1067         Remove FileError.h
1068         https://bugs.webkit.org/show_bug.cgi?id=213119
1069
1070         Reviewed by Chris Dumez.
1071
1072         * WebProcess/Network/WebSocketChannel.cpp:
1073         (WebKit::WebSocketChannel::createMessageQueue):
1074
1075 2020-06-12  Brian Burg  <bburg@apple.com>
1076
1077         Automation.computeElementLayout should return iframe-relative element rects (when coordinate system is 'Page')
1078         https://bugs.webkit.org/show_bug.cgi?id=213139
1079         <rdar://problem/55042445>
1080
1081         Reviewed by Devin Rousso.
1082
1083         Automation.computeElementLayout has two coordinate systems it can use, LayoutViewport (used for hit testing)
1084         and Page (used for Get Element Rect). Since Get Element Rect expects coordinates relative to the current
1085         browsing context, make the mode simpler by reporting the bounds from Element::boundingClientRect() which
1086         are frame-relative.
1087
1088         Covered by existing WPT suite. The semantics of this command are under review, as
1089         the remote end steps seem to describe a different result than what the non-normative text does.
1090
1091         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
1092         (WebKit::WebAutomationSessionProxy::computeElementLayout):
1093
1094 2020-06-12  David Kilzer  <ddkilzer@apple.com>
1095
1096         [IPC hardening] Check enum values in IPC::Decoder::decodeEnum() an IPC::Encoder::encodeEnum()
1097         <https://webkit.org/b/211988>
1098         <rdar://problem/63137695>
1099
1100         Reviewed by Darin Adler.
1101
1102         Replace decodeEnum() with decode() and encodeEnum() with
1103         operator<<().
1104
1105         * GPUProcess/media/TextTrackPrivateRemoteConfiguration.h:
1106         (WebKit::TextTrackPrivateRemoteConfiguration::encode const):
1107         * GPUProcess/media/TrackPrivateRemoteConfiguration.h:
1108         (WebKit::TrackPrivateRemoteConfiguration::encode const):
1109         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1110         (WebKit::NetworkProcessCreationParameters::encode const):
1111         (WebKit::NetworkProcessCreationParameters::decode):
1112         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1113         (WebKit::NetworkResourceLoadParameters::encode const):
1114         (WebKit::NetworkResourceLoadParameters::decode):
1115         * Platform/IPC/Decoder.h:
1116         (IPC::Decoder::decode):
1117         (IPC::Decoder::operator>>):
1118         - Make use of std::underlying_type_t<>.
1119         (IPC::Decoder::decodeEnum): Delete.
1120         - Replace with calls to decode().
1121         * Platform/IPC/Encoder.h:
1122         (IPC::Encoder::operator<<):
1123         (IPC::Encoder::encode):
1124         - Make use of WTF::enumToUnderlyingType<>.
1125         (IPC::Encoder::encodeEnum): Delete.
1126         - Replace with calls to operator<<().
1127         * Shared/Cocoa/ArgumentCodersCocoa.mm:
1128         (IPC::decodeObject):
1129         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
1130         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::encode):
1131         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::decode):
1132         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::LineItem>::encode):
1133         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::LineItem>::decode):
1134         * Shared/ContextMenuContextData.cpp:
1135         (WebKit::ContextMenuContextData::encode const):
1136         (WebKit::ContextMenuContextData::decode):
1137         * Shared/FocusedElementInformation.cpp:
1138         (WebKit::FocusedElementInformation::encode const):
1139         (WebKit::FocusedElementInformation::decode):
1140         * Shared/LoadParameters.cpp:
1141         (WebKit::LoadParameters::encode const):
1142         (WebKit::LoadParameters::decode):
1143         * Shared/NavigationActionData.cpp:
1144         (WebKit::NavigationActionData::encode const):
1145         (WebKit::NavigationActionData::decode):
1146         * Shared/PlatformPopupMenuData.cpp:
1147         (WebKit::PlatformPopupMenuData::encode const):
1148         (WebKit::PlatformPopupMenuData::decode):
1149         * Shared/Plugins/PluginProcessCreationParameters.cpp:
1150         (WebKit::PluginProcessCreationParameters::encode const):
1151         (WebKit::PluginProcessCreationParameters::decode):
1152         * Shared/PrintInfo.cpp:
1153         (WebKit::PrintInfo::encode const):
1154         (WebKit::PrintInfo::decode):
1155         * Shared/RTCPacketOptions.cpp:
1156         (WebKit::RTCPacketOptions::encode const):
1157         (WebKit::RTCPacketOptions::decode):
1158         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
1159         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::encode const):
1160         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::decode):
1161         (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode const):
1162         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
1163         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
1164         (ArgumentCoder<ScrollingStateNode>::encode):
1165         (ArgumentCoder<RequestedScrollData>::encode):
1166         (ArgumentCoder<RequestedScrollData>::decode):
1167         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
1168         * Shared/SessionState.cpp:
1169         (WebKit::HTTPBody::Element::encode const):
1170         (WebKit::HTTPBody::Element::decode):
1171         (WebKit::PageState::encode const):
1172         (WebKit::PageState::decode):
1173         * Shared/TouchBarMenuItemData.cpp:
1174         (WebKit::TouchBarMenuItemData::encode const):
1175         (WebKit::TouchBarMenuItemData::decode):
1176         * Shared/UserData.cpp:
1177         (WebKit::UserData::encode):
1178         (WebKit::UserData::decode):
1179         * Shared/WebContextMenuItemData.cpp:
1180         (WebKit::WebContextMenuItemData::encode const):
1181         (WebKit::WebContextMenuItemData::decode):
1182         * Shared/WebCoreArgumentCoders.cpp:
1183         (IPC::ArgumentCoder<LinearTimingFunction>::encode):
1184         (IPC::ArgumentCoder<CubicBezierTimingFunction>::encode):
1185         (IPC::ArgumentCoder<CubicBezierTimingFunction>::decode):
1186         (IPC::ArgumentCoder<StepsTimingFunction>::encode):
1187         (IPC::ArgumentCoder<SpringTimingFunction>::encode):
1188         (IPC::ArgumentCoder<PluginInfo>::encode):
1189         (IPC::ArgumentCoder<PluginInfo>::decode):
1190         (IPC::ArgumentCoder<ProtectionSpace>::encode):
1191         (IPC::ArgumentCoder<ProtectionSpace>::decode):
1192         (IPC::ArgumentCoder<Credential>::encode):
1193         (IPC::ArgumentCoder<Credential>::decode):
1194         (IPC::ArgumentCoder<Cursor>::encode):
1195         (IPC::ArgumentCoder<Cursor>::decode):
1196         (IPC::ArgumentCoder<ResourceError>::encode):
1197         (IPC::ArgumentCoder<ResourceError>::decode):
1198         (IPC::ArgumentCoder<DragData>::encode):
1199         (IPC::ArgumentCoder<DragData>::decode):
1200         (IPC::ArgumentCoder<CompositionUnderline>::encode):
1201         (IPC::ArgumentCoder<CompositionUnderline>::decode):
1202         (IPC::ArgumentCoder<FileChooserSettings>::encode):
1203         (IPC::ArgumentCoder<FileChooserSettings>::decode):
1204         (IPC::ArgumentCoder<TextCheckingRequestData>::encode):
1205         (IPC::ArgumentCoder<TextCheckingRequestData>::decode):
1206         (IPC::ArgumentCoder<TextCheckingResult>::encode):
1207         (IPC::ArgumentCoder<TextCheckingResult>::decode):
1208         (IPC::ArgumentCoder<UserStyleSheet>::encode):
1209         (IPC::ArgumentCoder<UserStyleSheet>::decode):
1210         (IPC::ArgumentCoder<ScrollableAreaParameters>::encode):
1211         (IPC::ArgumentCoder<ScrollableAreaParameters>::decode):
1212         (IPC::ArgumentCoder<FilterOperation>::encode):
1213         (IPC::decodeFilterOperation):
1214         (IPC::ArgumentCoder<FontAttributes>::encode):
1215         (IPC::ArgumentCoder<FontAttributes>::decode):
1216         (IPC::ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::encode):
1217         (IPC::ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::decode):
1218         * Shared/WebPageCreationParameters.cpp:
1219         (WebKit::WebPageCreationParameters::encode const):
1220         (WebKit::WebPageCreationParameters::decode):
1221         * Shared/WebPopupItem.cpp:
1222         (WebKit::WebPopupItem::encode const):
1223         (WebKit::WebPopupItem::decode):
1224         * Shared/WebProcessCreationParameters.cpp:
1225         (WebKit::WebProcessCreationParameters::encode const):
1226         (WebKit::WebProcessCreationParameters::decode):
1227         * Shared/WebsiteData/WebsiteData.cpp:
1228         (WebKit::WebsiteData::Entry::encode const):
1229         (WebKit::WebsiteData::Entry::decode):
1230         * Shared/curl/WebCoreArgumentCodersCurl.cpp:
1231         (IPC::ArgumentCoder<ResourceError>::encodePlatformData):
1232         (IPC::ArgumentCoder<ResourceError>::decodePlatformData):
1233         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData):
1234         (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData):
1235         * Shared/glib/InputMethodState.cpp:
1236         (WebKit::InputMethodState::encode const):
1237         (WebKit::InputMethodState::decode):
1238         * Shared/glib/UserMessage.cpp:
1239         (WebKit::UserMessage::encode const):
1240         (WebKit::UserMessage::decode):
1241         * Shared/mac/ColorSpaceData.mm:
1242         (WebKit::ColorSpaceData::encode const):
1243         (WebKit::ColorSpaceData::decode):
1244         * Shared/mac/SecItemRequestData.cpp:
1245         (WebKit::SecItemRequestData::encode const):
1246         (WebKit::SecItemRequestData::decode):
1247         * Shared/mac/WebCoreArgumentCodersMac.mm:
1248         (IPC::ArgumentCoder<WebCore::ResourceRequest>::encodePlatformData):
1249         (IPC::ArgumentCoder<WebCore::ResourceRequest>::decodePlatformData):
1250         (IPC::ArgumentCoder<WebCore::CertificateInfo>::encode):
1251         (IPC::ArgumentCoder<WebCore::CertificateInfo>::decode):
1252         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
1253         (IPC::ArgumentCoder<SoupNetworkProxySettings>::encode):
1254         (IPC::ArgumentCoder<SoupNetworkProxySettings>::decode):
1255         * WebProcess/GPU/media/RemoteMediaPlayerState.h:
1256         (WebKit::RemoteMediaPlayerState::encode const):
1257         (WebKit::RemoteMediaPlayerState::decode):
1258         * WebProcess/Network/NetworkProcessConnectionInfo.h:
1259         (WebKit::NetworkProcessConnectionInfo::decode):
1260         * WebProcess/Plugins/Plugin.cpp:
1261         (WebKit::Plugin::Parameters::encode const):
1262         (WebKit::Plugin::Parameters::decode):
1263         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
1264         (WebKit::PlatformCAAnimationRemote::KeyframeValue::encode const):
1265         (WebKit::PlatformCAAnimationRemote::KeyframeValue::decode):
1266         (WebKit::PlatformCAAnimationRemote::Properties::encode const):
1267         (WebKit::PlatformCAAnimationRemote::Properties::decode):
1268
1269 2020-06-12  Wenson Hsieh  <wenson_hsieh@apple.com>
1270
1271         [iPadOS] Focusing selects and color inputs should not bring up the software keyboard
1272         https://bugs.webkit.org/show_bug.cgi?id=213149
1273         <rdar://problem/64312450>
1274
1275         Reviewed by Darin Adler.
1276
1277         After <trac.webkit.org/r261658>, we now opt into bringing up the software keyboard when focusing color inputs
1278         and select elements. This is due to the changes in `-_shouldShowAutomaticKeyboardUIIgnoringInputMode`, which
1279         were intended to make us return `NO` for date and time inputs, but also unintentionally makes us return `YES`
1280         on iPadOS.
1281
1282         This patch fixes the bug by returning `!WebKit::currentUserInterfaceIdiomIsPad()` instead, and additionally
1283         preserves the existing behavior of now showing a color picker for `<input type="color" readonly>` on iPhone.
1284
1285         Test: fast/forms/ios/ipad/select-should-not-bring-up-software-keyboard.html
1286
1287         * UIProcess/ios/WKContentViewInteraction.mm:
1288         (-[WKContentView becomeFirstResponderForWebView]):
1289         (-[WKContentView resignFirstResponderForWebView]):
1290         (-[WKContentView _shouldShowAutomaticKeyboardUIIgnoringInputMode]):
1291         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]):
1292
1293 2020-06-12  Alex Christensen  <achristensen@webkit.org>
1294
1295         Make API tests tolerant of our relatively new use of WebPageProxy::preconnectTo
1296         https://bugs.webkit.org/show_bug.cgi?id=213144
1297
1298         Reviewed by Geofferey Garen.
1299
1300         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
1301         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1302         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
1303         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
1304         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
1305         (WebKit::NetworkSessionCocoa::taskServerConnectionSucceeded):
1306         (WebKit::NetworkSessionCocoa::taskReceivedBytes): Deleted.
1307         Fix our logic that remembers successful client certificate connections.
1308         If a task completes with no error (like a preconnect task does), consider that a successful connection.
1309
1310         * UIProcess/Network/NetworkProcessProxy.cpp:
1311         (WebKit::NetworkProcessProxy::preconnectTo):
1312         Remove the check to not preconnect to loopback addresses.
1313         This was making our tests different than the real internet and prevented me from landing a perfectly good test
1314         in https://bugs.webkit.org/show_bug.cgi?id=213109
1315
1316 2020-06-12  Per Arne Vollan  <pvollan@apple.com>
1317
1318         [iOS] Preferences are not being observed if the process pool is being created after activation
1319         https://bugs.webkit.org/show_bug.cgi?id=213145
1320
1321         Reviewed by Brent Fulgham.
1322
1323         If the app is creating the Web process pool after being activated, preferences will not be observed until the app is being backgrounded
1324         and then foregrounded again, since the preference observer is initialized when handling the app activation notification.
1325
1326         No new tests, since an API test would make sense in this case, but API tests aren't run on iOS.
1327
1328         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1329         (WebKit::WebProcessPool::platformInitializeWebProcess):
1330
1331 2020-06-12  Takashi Komori  <Takashi.Komori@sony.com>
1332
1333         [Curl] Implement functions to use ResourceLoadStatistics.
1334         https://bugs.webkit.org/show_bug.cgi?id=207692
1335
1336         Reviewed by Don Olmstead.
1337
1338         Implement functions which are required to implement ResourceLoadStatistics for Curl port.
1339
1340         In NetworkDataTaskCurl.cpp we check if we should block cookies and block if needed.
1341
1342         Tests: http/tests/resourceLoadStatistics/
1343
1344         * NetworkProcess/NetworkDataTask.cpp:
1345         (WebKit::NetworkDataTask::create):
1346         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
1347         (WebKit::NetworkDataTaskCurl::NetworkDataTaskCurl):
1348         (WebKit::NetworkDataTaskCurl::createCurlRequest):
1349         (WebKit::NetworkDataTaskCurl::willPerformHTTPRedirection):
1350         (WebKit::NetworkDataTaskCurl::blockCookies):
1351         (WebKit::NetworkDataTaskCurl::unblockCookies):
1352         (WebKit::NetworkDataTaskCurl::shouldBlockCookies):
1353         (WebKit::NetworkDataTaskCurl::isThirdPartyRequest):
1354         * NetworkProcess/curl/NetworkDataTaskCurl.h:
1355         * NetworkProcess/curl/NetworkSessionCurl.cpp:
1356         (WebKit::NetworkSessionCurl::NetworkSessionCurl):
1357         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1358         (WKWebsiteDataStoreGetAllStorageAccessEntries):
1359         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1360         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1361         (WebKit::WebsiteDataStore::parameters):
1362
1363 2020-06-12  Antoine Quint  <graouts@webkit.org>
1364
1365         Double tap to zoom out doesn't work after upgrading to iOS 13
1366         https://bugs.webkit.org/show_bug.cgi?id=205158
1367         <rdar://problem/205158>
1368
1369         Reviewed by Wenson Hsieh.
1370
1371         Test: fast/events/ios/fast-click-double-tap-to-zoom-in-on-text-and-then-again-to-zoom-out.html
1372
1373         In order to determine whether a significant zoom to happen, we should use the current page scale
1374         factor and not the initial page scale factor.
1375
1376         * UIProcess/ios/WKContentViewInteraction.mm:
1377         (-[WKContentView _handleSmartMagnificationInformationForPotentialTap:renderRect:fitEntireRect:viewportMinimumScale:viewportMaximumScale:nodeIsRootLevel:]):
1378
1379 2020-06-12  Alex Christensen  <achristensen@webkit.org>
1380
1381         Add WKUserScript initializer SPI with alternative names
1382         https://bugs.webkit.org/show_bug.cgi?id=213096
1383
1384         Reviewed by Youenn Fablet.
1385
1386         And deprecate the existing ones so we can remove them soon.
1387
1388         * UIProcess/API/Cocoa/WKUserScript.mm:
1389         (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:includeMatchPatternStrings:excludeMatchPatternStrings:associatedURL:contentWorld:deferRunningUntilNotification:]):
1390         * UIProcess/API/Cocoa/WKUserScriptPrivate.h:
1391
1392 2020-06-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1393
1394         Unreviewed. Fix GTK4 build
1395
1396         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1397         (webkitWebViewBaseSynthesizeKeyEvent):
1398
1399 2020-06-11  Sam Weinig  <weinig@apple.com>
1400
1401         Document.currentScript does not work for SVGScriptElements
1402         https://bugs.webkit.org/show_bug.cgi?id=213104
1403
1404         Reviewed by Yusuke Suzuki.
1405
1406         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp:
1407         (webkit_dom_document_get_current_script):
1408         Update to account for change in Document::currentScript() now returning an
1409         Element* that can be either an HTMLScriptElement or an SVGScriptElement. To
1410         keep API compatibility, only return non-null for HTMLScriptElements.
1411
1412 2020-06-12  Charlie Turner  <cturner@igalia.com>
1413
1414         [GTK] Add an internal API to run javascript without forced user gestures
1415         https://bugs.webkit.org/show_bug.cgi?id=212969
1416
1417         Reviewed by Carlos Garcia Campos.
1418
1419         To be used by tests in a follow-up commit.
1420
1421         * UIProcess/API/glib/WebKitWebView.cpp:
1422         (webkitWebViewRunJavaScriptWithParams): Factor out the glue to run
1423         JavaScript in the page.
1424         (webkitWebViewRunJavascriptWithoutForcedUserGestures): Add a new
1425         internal API for use by tests.
1426         (webkit_web_view_run_javascript): Modified to use factored out
1427         glue.
1428         * UIProcess/API/glib/WebKitWebViewInternal.h: Added. Place to keep
1429         API test-specific internal APIs.
1430
1431 2020-06-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1432
1433         [GTK4] Make WebDriver work
1434         https://bugs.webkit.org/show_bug.cgi?id=212316
1435
1436         Reviewed by Adrian Perez de Castro.
1437
1438         Fix UIClient::setWindowFrame to wait for surface size-changed signal after resizing the window and implement
1439         maximize, minimize and restore windows for GTK4.
1440
1441         * UIProcess/API/glib/WebKitUIClient.cpp:
1442         * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
1443         (surfaceStateChangedCallback):
1444         (webkitWebViewMonitorWindowState):
1445         (webkitWebViewMaximizeWindow):
1446         (webkitWebViewMinimizeWindow):
1447         (webkitWebViewRestoreWindow):
1448
1449 2020-06-11  David Kilzer  <ddkilzer@apple.com>
1450
1451         [IPC] Add WTF::EnumTraits<> for every enum type used in IPC
1452         <https://webkit.org/b/213093>
1453
1454         Reviewed by Darin Adler.
1455
1456         Summary:
1457         - Change underlying type of enum class to `bool` when there are
1458           only two values.  In some cases, reorder the two values so the
1459           mapping to 0 and 1 makes more sense.  Converting every enum to
1460           an enum class is not a goal of this patch, so some two-value
1461           enums stil have WTF::EnumTraits<> defined as noted below.
1462         - Add WTF::EnumTraits<> for the remaining enum types that are
1463           used by IPC::Encoder::encodeEnum() and
1464           IPC::Decoder::decodeEnum() so that WTF::isValidEnum<>() checks
1465           may be added next.
1466         - Add #include <WebCore/LibWebRTCEnumTraits.h> as needed.
1467
1468         * GPUProcess/GPUConnectionToWebProcess.h:
1469         * GPUProcess/GPUProcess.h:
1470         * NetworkProcess/NetworkLoadParameters.h:
1471         * Shared/API/APIObject.h:
1472         * Shared/ContextMenuContextData.h:
1473         * Shared/DrawingAreaInfo.h:
1474         * Shared/FocusedElementInformation.h:
1475         * Shared/PrintInfo.h:
1476         (WTF::EnumTraits<WebKit::PrintInfo::PrintMode>):
1477         - Define this since PrintMode is not an enum class.
1478         * Shared/RTCPacketOptions.cpp:
1479         * Shared/SessionState.h:
1480         * Shared/TouchBarMenuItemData.h:
1481         * Shared/WebEvent.h:
1482         * Shared/WebPopupItem.cpp:
1483         (WebKit::WebPopupItem::WebPopupItem):
1484         - Fix reference to WebPopupItem::Type enum.
1485         * Shared/WebPopupItem.h:
1486         (WebKit::WebPopupItem::Type):
1487         - Convert from enum to enum class.
1488         * Shared/WebsiteData/WebsiteDataType.h:
1489         * Shared/glib/InputMethodState.h:
1490         * Shared/glib/UserMessage.h:
1491         * Shared/mac/ColorSpaceData.mm:
1492         * Shared/mac/SecItemRequestData.h:
1493         * UIProcess/mac/WebPopupMenuProxyMac.mm:
1494         (WebKit::WebPopupMenuProxyMac::populate):
1495         - Fix reference to WebPopupItem::Type enum.
1496         * WebProcess/Plugins/Plugin.cpp:
1497         * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
1498         (WebKit::WebPopupMenu::populateItems):
1499         - Fix reference to WebPopupItem::Type enum.
1500         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h:
1501
1502 2020-06-11  Alex Christensen  <achristensen@webkit.org>
1503
1504         Re-enable download resume tests
1505         https://bugs.webkit.org/show_bug.cgi?id=213098
1506         <rdar://problem/63512518>
1507
1508         Reviewed by Geoffrey Garen.
1509
1510         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1511         (-[WKNetworkSessionDelegate URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:]):
1512
1513 2020-06-11  Beth Dakin  <bdakin@apple.com>
1514
1515         Replace instances of whitelist in WebCore with allowlist
1516         https://bugs.webkit.org/show_bug.cgi?id=213068
1517
1518         Reviewed by Tim Horton.
1519
1520         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1521         (WebKit::NetworkConnectionToWebProcess::addOriginAccessWhitelistEntry):
1522         (WebKit::NetworkConnectionToWebProcess::removeOriginAccessWhitelistEntry):
1523         (WebKit::NetworkConnectionToWebProcess::resetOriginAccessWhitelists):
1524         * Shared/WebCoreArgumentCoders.cpp:
1525         (IPC::ArgumentCoder<UserStyleSheet>::encode):
1526         (IPC::ArgumentCoder<UserStyleSheet>::decode):
1527         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1528         (WebKit::InjectedBundle::addOriginAccessWhitelistEntry):
1529         (WebKit::InjectedBundle::removeOriginAccessWhitelistEntry):
1530         (WebKit::InjectedBundle::resetOriginAccessWhitelists):
1531         * WebProcess/cocoa/WebProcessCocoa.mm:
1532         (WebKit::WebProcess::platformInitializeWebProcess):
1533
1534 2020-06-11  Jonathan Bedard  <jbedard@apple.com>
1535
1536         WebKit: Guard requestDocumentContext with HAVE(UI_WK_DOCUMENT_CONTEXT)
1537         https://bugs.webkit.org/show_bug.cgi?id=213076
1538         <rdar://problem/64254698>
1539
1540         Reviewed by Tim Horton.
1541
1542         No new tests, behavior unchanged.
1543
1544         * Platform/spi/ios/UIKitSPI.h:
1545         * UIProcess/API/ios/WKWebViewTestingIOS.mm:
1546         (-[WKWebView _requestDocumentContext:completionHandler:]): Guard requestDocumentContext with HAVE(UI_WK_DOCUMENT_CONTEXT).
1547         (-[WKWebView _adjustSelectionWithDelta:completionHandler:]): Ditto.
1548
1549 2020-06-11  Jonathan Bedard  <jbedard@apple.com>
1550
1551         WebKit: Add UIKit SPI for watchOS and tvOS
1552         https://bugs.webkit.org/show_bug.cgi?id=213077
1553         <rdar://problem/64255131>
1554
1555         Reviewed by Tim Horton.
1556
1557         No new tests, behavior unchanged.
1558
1559         * Platform/spi/ios/UIKitSPI.h:
1560
1561 2020-06-11  David Kilzer  <ddkilzer@apple.com>
1562
1563         [IPC] Adopt enum class for DragSourceAction
1564         <https://webkit.org/b/212885>
1565         <rdar://problem/64094134>
1566
1567         Reviewed by Darin Adler.
1568
1569         Summary:
1570         - Convert argument parameters from uint64_t to
1571           OptionSet<DragSourceAction>.
1572         - Convert DragSourceAction to OptionSet<DragSourceAction>.
1573
1574         * Scripts/webkit/messages.py:
1575         - Map DragSourceAction enum to DragActions.h header.
1576         * UIProcess/WebPageProxy.h:
1577         * UIProcess/ios/DragDropInteractionState.h:
1578         * UIProcess/ios/DragDropInteractionState.mm:
1579         (WebKit::shouldUseDragImageToCreatePreviewForDragSource):
1580         (WebKit::shouldUseVisiblePathToCreatePreviewForDragSource):
1581         (WebKit::shouldUseTextIndicatorToCreatePreviewForDragSource):
1582         (WebKit::canUpdatePreviewForActiveDragSource):
1583         (WebKit::DragDropInteractionState::anyActiveDragSourceIs const):
1584         (WebKit::DragDropInteractionState::stageDragItem):
1585         (WebKit::DragDropInteractionState::hasStagedDragSource const):
1586         (WebKit::DragDropInteractionState::updatePreviewsForActiveDragSources):
1587         * UIProcess/ios/WKContentViewInteraction.mm:
1588         (-[WKContentView _startDrag:item:]):
1589         (-[WKContentView _allowedDragSourceActions]):
1590         (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
1591         * UIProcess/ios/WebPageProxyIOS.mm:
1592         (WebKit::WebPageProxy::requestDragStart):
1593         (WebKit::WebPageProxy::requestAdditionalItemsForDragSession):
1594         * WebProcess/WebCoreSupport/WebDragClient.cpp:
1595         (WebKit::WebDragClient::dragSourceActionMaskForPoint):
1596         * WebProcess/WebCoreSupport/WebDragClient.h:
1597         * WebProcess/WebPage/WebPage.h:
1598         (WebKit::WebPage::allowedDragSourceActions const):
1599         * WebProcess/WebPage/WebPage.messages.in:
1600         * WebProcess/WebPage/ios/WebPageIOS.mm:
1601         (WebKit::WebPage::requestDragStart):
1602         (WebKit::WebPage::requestAdditionalItemsForDragSession):
1603
1604 2020-06-11  Eric Carlson  <eric.carlson@apple.com>
1605
1606         [Cocoa] MediaUsageManagerCocoa should use a different USVideoUsage initializer
1607         https://bugs.webkit.org/show_bug.cgi?id=213058
1608
1609         Reviewed by Jer Noble.
1610
1611         No new tests, tested manually.
1612
1613         * UIProcess/Media/cocoa/MediaUsageManagerCocoa.mm:
1614         (WebKit::MediaUsageManagerCocoa::reset): Drive-by fix: don't call -stop unless the
1615         element was playing.
1616         (WebKit::MediaUsageManagerCocoa::updateMediaUsage): Use a different initializer so
1617         we can pass in the state.
1618
1619 2020-06-11  ChangSeok Oh  <changseok@webkit.org>
1620
1621         [GTK] Implement button-press-event, button-release-event, and absolute-axis-event of GAMEPAD API.
1622         https://bugs.webkit.org/show_bug.cgi?id=133850
1623
1624         Reviewed by Carlos Garcia Campos.
1625
1626         * UIProcess/Gamepad/UIGamepadProvider.cpp: Add the OS(LINUX) guard.
1627         * UIProcess/Gamepad/gtk/UIGamepadProviderGtk.cpp:
1628         (WebKit::getWebPageProxy): Build fix. WebKitWebViewBase is used, not WebKitWebViewPrivate.
1629         * UIProcess/Gamepad/manette/UIGamepadProviderManette.cpp: Add the OS(LINUX) guard.
1630
1631 2020-06-10  Said Abou-Hallawa  <sabouhallawa@apple.com>
1632
1633         [macOS]: The File Picker of the <input> file element should show the selection filter
1634         https://bugs.webkit.org/show_bug.cgi?id=212485
1635
1636         Reviewed by Darin Adler.
1637
1638         Add two private helpers to WKOpenPanelParameters.
1639
1640         * UIProcess/API/Cocoa/WKOpenPanelParameters.mm:
1641         (-[WKOpenPanelParameters _allowedFileExtensions]):
1642         Returns an array of strings representing the allowed extensions.
1643
1644         (-[WKOpenPanelParameters _allowedFileExtensionsDescription]):
1645         Returns a string representing a description for the allowed extensions.
1646
1647         * UIProcess/API/Cocoa/WKOpenPanelParametersPrivate.h:
1648
1649 2020-06-10  Beth Dakin  <bdakin@apple.com>
1650
1651         Replace instances of blacklist in WebCore with blocklist
1652         https://bugs.webkit.org/show_bug.cgi?id=213064
1653
1654         Reviewed by Tim Horton.
1655
1656         * Shared/WebCoreArgumentCoders.cpp:
1657         (IPC::ArgumentCoder<UserStyleSheet>::encode):
1658         (IPC::ArgumentCoder<UserStyleSheet>::decode):
1659
1660 2020-06-10  Wenson Hsieh  <wenson_hsieh@apple.com>
1661
1662         [iOS] editing/pasteboard/dom-paste tests consistently time out
1663         https://bugs.webkit.org/show_bug.cgi?id=213061
1664         <rdar://problem/64211161>
1665
1666         Reviewed by Darin Adler.
1667
1668         On recent versions of iOS, system changes have moved the timing of the call to
1669         `-requestAutocorrectionContextWithCompletionHandler:` when focusing an editable element. This results in a
1670         consistently reproducible deadlock between the UI process and web process if a page tries to request
1671         programmatic clipboard access during the click event (importantly, in the same runloop as element focus).
1672
1673         What ends up happening is that the autocorrection context is requested by the UI process shortly after the
1674         (unbounded) sync IPC message for the DOM paste arrives, so we end up waiting forever for the sync-IPC-blocked
1675         web process to respond. Normally this just results in a 1 second hang, and the DOM paste proceeds as normal.
1676         However these layout tests purposefully opt out of sync IPC timeouts (precisely so that we can catch bugs like
1677         this). See below for more details.
1678
1679         * UIProcess/ios/WKContentViewInteraction.h:
1680
1681         Keep track of the most recent autocorrection context that arrived in the UI process.
1682
1683         * UIProcess/ios/WKContentViewInteraction.mm:
1684         (-[WKContentView cleanUpInteraction]):
1685
1686         Clear out the autocorrection context, in case the web process crashes.
1687
1688         (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
1689
1690         If the autocorrection context is requested while handling a DOM paste, we know that the latest autocorrection
1691         context must be up to date, since the autocorrection context is computed and sent immediately before a DOM paste
1692         request. Use this to immediately invoke the completion handler, without any sync IPC back to the web process.
1693
1694         (-[WKContentView _handleAutocorrectionContext:]):
1695
1696 2020-06-10  Hiro (mzp) Mizuno  <mzp@apple.com>
1697
1698         [iOS] Option + Forward Delete should delete next word
1699         https://bugs.webkit.org/show_bug.cgi?id=213062
1700         rdar://64225458
1701
1702         Reviewed by Daniel Bates.
1703
1704         Implement support for pressing Option + Forward Delete to delete the next word. This makes text editing
1705         in WebKit more closely match the platform conventions.
1706
1707         * UIProcess/ios/WKContentViewInteraction.mm:
1708         (-[WKContentView canPerformAction:withSender:]): Handle _deleteForwardByWord.
1709         (-[WKContentView _deleteForwardByWord]): Added.
1710
1711 2020-06-10  Geoffrey Garen  <ggaren@apple.com>
1712
1713         Some style improvements to main thread code
1714         https://bugs.webkit.org/show_bug.cgi?id=213051
1715
1716         Reviewed by Darin Adler.
1717
1718         Updated for rename.
1719
1720         * Shared/Cocoa/WebKit2InitializeCocoa.mm:
1721         (WebKit::runInitializationCode):
1722         (WebKit::InitializeWebKit2):
1723         * Shared/WebKit2Initialize.cpp:
1724         (WebKit::InitializeWebKit2):
1725
1726 2020-06-10  Jonathan Bedard  <jbedard@apple.com>
1727
1728         WebKit:Add PepperUICoreSPI.h (Follow-up fix 2)
1729         https://bugs.webkit.org/show_bug.cgi?id=212996
1730         <rdar://problem/64182627>
1731
1732         Unreviewed build fix.
1733
1734         * UIProcess/ios/forms/WKNumberPadViewController.mm:
1735         (-[WKNumberPadViewController addContentViewAnimations:]): Correct APPLE_INTERNAL_SDK macro.
1736         * UIProcess/ios/forms/WKQuickboardListViewController.mm:
1737         (-[WKQuickboardListViewController initWithDelegate:]): Ditto.
1738
1739 2020-06-10  Jonathan Bedard  <jbedard@apple.com>
1740
1741         WebKit:Add PepperUICoreSPI.h (Follow-up fix)
1742         https://bugs.webkit.org/show_bug.cgi?id=212996
1743         <rdar://problem/64182627>
1744
1745         Unreviewed build fix.
1746
1747         * Platform/spi/watchos/PepperUICoreSPI.h: Add PUICPickerView headers.
1748
1749 2020-06-10  David Kilzer  <ddkilzer@apple.com>
1750
1751         REGRESSION (r262858): Fix macOS build when building EndowmentStateTracker.mm
1752
1753         * UIProcess/EndowmentStateTracker.mm:
1754         - Move #if PLATFORM(IOS_FAMILY) to fix macOS build.
1755
1756 2020-06-10  Per Arne Vollan  <pvollan@apple.com>
1757
1758         [Cocoa] Return early from preference change notification handler if there is no observer
1759         https://bugs.webkit.org/show_bug.cgi?id=213050
1760
1761         Reviewed by Darin Adler.
1762
1763         Currently, the observer member is checked inside the loop iterating over all the keys,
1764         but this check should be moved outside of the loop.
1765
1766         No new tests, since this is not a change in behavior.
1767
1768         * UIProcess/Cocoa/PreferenceObserver.mm:
1769         (-[WKUserDefaults _notifyObserversOfChangeFromValuesForKeys:toValuesForKeys:]):
1770
1771 2020-06-10  Brady Eidson  <beidson@apple.com>
1772
1773         Crash growing a CFData with incremental PDF loading.
1774         <rdar://problem/63670403> and https://bugs.webkit.org/show_bug.cgi?id=213035
1775
1776         Reviewed by Alex Christensen.
1777
1778         No test - No reliable way to trigger.
1779
1780         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1781         (WebKit::PDFPlugin::ensureDataBufferLength): When you call CFDataCreateMutable with a size other than 0,
1782           your data object can never grow beyond that size.
1783           And, in fact, CFData will crash on purpose when this is attempted.
1784           So always create our mutable CFDatas with size 0 even if we immediately plan to grow them.
1785
1786 2020-06-10  Jonathan Bedard  <jbedard@apple.com>
1787
1788         WebKit: Add ClockKitSPI.h
1789         https://bugs.webkit.org/show_bug.cgi?id=212994
1790         <rdar://problem/64181092>
1791
1792         Reviewed by Wenson Hsieh.
1793
1794         No new tests, behavior unchanged.
1795
1796         * Platform/spi/watchos: Added.
1797         * Platform/spi/watchos/ClockKitSPI.h: Added.
1798         * UIProcess/ios/forms/WKTimePickerViewController.mm: Import ClockKitSPI.h and UIKitSPI.h.
1799         * WebKit.xcodeproj/project.pbxproj: Include ClockKitSPI.
1800
1801 2020-06-10  Brian Burg  <bburg@apple.com>
1802
1803         WebDriver on non-iOS ports cannot perform ActionChain which has scrolling down to the element and click it
1804         https://bugs.webkit.org/show_bug.cgi?id=208232
1805         <rdar://problem/59859491>
1806
1807         Reviewed by Devin Rousso.
1808
1809         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
1810         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
1811         The provided coordinates are in LayoutViewport coordinate system, which does
1812         not take topContentInset into account. Add back in the topContentInset
1813         when translating to flipped window coordinates.
1814
1815         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
1816         (WebKit::WebAutomationSessionProxy::computeElementLayout):
1817         The calculations of element bounds and IVCP have an incorrect handling of
1818         root coordinates as contents/absolute coordinates. Add the missing conversion.
1819
1820 2020-06-10  Brent Fulgham  <bfulgham@apple.com>
1821
1822         [iOS] Update sandbox rules for correct sanitizer paths in current OS releases
1823         https://bugs.webkit.org/show_bug.cgi?id=213040
1824         <rdar://problem/64187043>
1825
1826         Reviewed by Per Arne Vollan.
1827
1828         Update the sandbox rules on iOS platforms to allow access to the
1829         new system locations for Asan libraries.
1830
1831         * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb:
1832         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
1833         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1834
1835 2020-06-10  Jer Noble  <jer.noble@apple.com>
1836
1837         Catalyst WebKit apps continue to play audio after quitting
1838         https://bugs.webkit.org/show_bug.cgi?id=212981
1839         <rdar://problem/57089471>
1840
1841         Reviewed by Chris Dumez.
1842
1843         RunningBoard will track whether a process (and it's associated child processes) are "user-visible" by
1844         granting those processes an "endowment", similar to the existing endowment for application visibility.
1845         Track changes to these endowments using a RBSProcessMonitor, and for Catalyst apps, react to losing the
1846         "user-visible" endowment by suspending all media playback.
1847
1848         Move all the endowment-related code into a new class, EndowmentStateTracker, which is a singleton object
1849         that can have mulitple WebPageProxy clients. Update references to the previously global static
1850         isApplicationForeground() function to refer to EndowmentStateTracker instead.
1851
1852         Drive-by fix: move some iOS-only functions in WebPageProxy.cpp into WebPageProxyIOS.mm.
1853
1854         * UIProcess/ApplicationStateTracker.h:
1855         * UIProcess/ApplicationStateTracker.mm:
1856         (WebKit::ApplicationStateTracker::ApplicationStateTracker):
1857         (WebKit::isApplicationForeground): Deleted.
1858         * UIProcess/EndowmentStateTracker.h: Added.
1859         (WebKit::EndowmentStateTracker::isVisible const):
1860         (WebKit::EndowmentStateTracker::isUserFacing const):
1861         * UIProcess/EndowmentStateTracker.mm: Added.
1862         (WebKit::handleForPID):
1863         (WebKit::EndowmentStateTracker::isApplicationForeground):
1864         (WebKit::EndowmentStateTracker::isApplicationUserFacing):
1865         (WebKit::EndowmentStateTracker::singleton):
1866         (WebKit::EndowmentStateTracker::EndowmentStateTracker):
1867         (WebKit::EndowmentStateTracker::addClient):
1868         (WebKit::EndowmentStateTracker::removeClient):
1869         (WebKit::EndowmentStateTracker::setIsUserFacing):
1870         (WebKit::EndowmentStateTracker::setIsVisible):
1871         * UIProcess/WebPageProxy.cpp:
1872         (WebKit::m_limitsNavigationsToAppBoundDomains):
1873         (WebKit::WebPageProxy::~WebPageProxy):
1874         (WebKit::WebPageProxy::processWillBecomeSuspended): Deleted.
1875         (WebKit::WebPageProxy::processWillBecomeForeground): Deleted.
1876         * UIProcess/WebPageProxy.h:
1877         * UIProcess/ios/PageClientImplIOS.mm:
1878         (WebKit::PageClientImpl::isApplicationVisible):
1879         * UIProcess/ios/WebPageProxyIOS.mm:
1880         (WebKit::WebPageProxy::processWillBecomeSuspended):
1881         (WebKit::WebPageProxy::processWillBecomeForeground):
1882         (WebKit::WebPageProxy::isUserFacingChanged):
1883         (WebKit::WebPageProxy::isVisibleChanged):
1884         * WebKit.xcodeproj/project.pbxproj:
1885
1886 2020-06-10  Antoine Quint  <graouts@webkit.org>
1887
1888         Subframes should not autosize independently
1889         https://bugs.webkit.org/show_bug.cgi?id=212984
1890         <rdar://problem/64175493>
1891
1892         Reviewed by Simon Fraser.
1893
1894         Ensure we only call FrameView::enableSizeToContentAutoSizeMode() for the main frame.
1895
1896         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1897         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
1898
1899 2020-06-10  Jonathan Bedard  <jbedard@apple.com>
1900
1901         WebKit:Add PepperUICoreSPI.h
1902         https://bugs.webkit.org/show_bug.cgi?id=212996
1903         <rdar://problem/64182627>
1904
1905         Reviewed by Tim Horton.
1906
1907         No new tests, behavior unchanged.
1908
1909         * Platform/spi/watchos: Added.
1910         * Platform/spi/watchos/PepperUICoreSPI.h: Added.
1911         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm: Include PepperUICoreSPI header.
1912         * UIProcess/ios/WKScrollView.mm: Ditto.
1913         * UIProcess/ios/forms/WKDatePickerViewController.mm: Remove headers duplicated in PepperUICoreSPI.h.
1914         * UIProcess/ios/forms/WKFocusedFormControlView.mm: Ditto.
1915         * UIProcess/ios/forms/WKNumberPadView.mm: Include PepperUICoreSPI header.
1916         * UIProcess/ios/forms/WKNumberPadViewController.h: Remove headers duplicated in PepperUICoreSPI.h.
1917         * UIProcess/ios/forms/WKNumberPadViewController.mm: Ditto.
1918         (-[WKNumberPadViewController addContentViewAnimations:]): Limit addAnimation to Internal builds.
1919         * UIProcess/ios/forms/WKQuickboardListViewController.h: Include PepperUICoreSPI header.
1920         * UIProcess/ios/forms/WKQuickboardListViewController.mm: Remove headers duplicated in PepperUICoreSPI.h.
1921         (-[WKQuickboardListViewController initWithDelegate:]):
1922         * UIProcess/ios/forms/WKSelectMenuListViewController.mm: Remove headers duplicated in PepperUICoreSPI.h.
1923         * UIProcess/ios/forms/WKTextInputListViewController.mm: Ditto.
1924         * WebKit.xcodeproj/project.pbxproj: Add PepperUICoreSPI.h.
1925
1926 2020-06-10  Per Arne Vollan  <pvollan@apple.com>
1927
1928         [iOS] Add entitlement for PAC exceptions
1929         https://bugs.webkit.org/show_bug.cgi?id=213027
1930         <rdar://problem/63985737>
1931
1932         Reviewed by Brent Fulgham.
1933
1934         On iOS, add entitlement for PAC exceptions.
1935
1936         * Scripts/process-entitlements.sh:
1937
1938 2020-06-10  James Savage  <james.savage@apple.com>
1939
1940         Swift Overlay API refinements
1941         https://bugs.webkit.org/show_bug.cgi?id=212939
1942         <rdar://problem/64140013>
1943
1944         Reviewed by Darin Adler.
1945
1946         This patch cleans up some inconsistencies in the various Swift projections,
1947         and modifies JavaScript evaluation callbacks to be optional to account for
1948         scripts which may not evaluate to a useful result (such as ones that simply
1949         modify the DOM without reporting a status). It also standardizes on using
1950         completionHandler as an argument label to match the rest of WebKit API, and
1951         the majority of the Swift API refinements.
1952         
1953         It also fixes a module issue where the WebKit.h umbrella was missing an
1954         import of WKScriptReplyWithMessageHandler.h, making the type unusable from
1955         Swift source files/
1956
1957         * Shared/API/Cocoa/WebKit.h: Add missing header.
1958         * UIProcess/API/Cocoa/WebKitSwiftOverlay.swift:
1959         (callAsyncJavaScript(_:arguments:in:completionHandler:)): Rename completion
1960             argument, and make optional. Note: Optional closures are implicitly
1961             @escaping, making the annotation redundant and incompatible, so it must
1962             be removed. In Swift, Optional.map()'s closure is invoked iff the Optional
1963             contains some value, and the result of that transform is returned, else
1964             nil is propagated. This allows us to apply the closure transform if the
1965             client value is non-nil, without using intermediary variables or if/let.
1966         (evaluateJavaScript(_:in:completionHandler:)): Ditto.
1967         * SwiftOverlay/Tests/WebKitTests.swift:
1968         (WebKitTests.testAPI): Update names to reflect changes.
1969         * SwiftOverlay/WebKitSwiftOverlay.xcodeproj/xcshareddata/xcschemes/Everything (Catalyst).xcscheme:
1970             Ensure that the unit test files get built as part of Build & Run, so that
1971             any changes to names get flagged without even running the tests.
1972         * SwiftOverlay/WebKitSwiftOverlay.xcodeproj/xcshareddata/xcschemes/Everything.xcscheme:
1973             Ditto.
1974
1975 2020-06-10  Kate Cheney  <katherine_cheney@apple.com>
1976
1977         ASSERTION FAILED: suspendedState == State::Running in WebKit::WebResourceLoadStatisticsStore::suspend
1978         https://bugs.webkit.org/show_bug.cgi?id=213031
1979         <rdar://problem/64131092>
1980
1981         Reviewed by Chris Dumez.
1982
1983         There is a race condition if two calls are made to
1984         WebResourceLoadStatisticsStore::suspend() simultanously.
1985         WebResourceLoadStatisticsStore::resume() notifies the background
1986         thread to continue and releases a lock, then sometimes the second call
1987         to suspend obtains the lock and updates the suspendedState variable
1988         before the background thread resumes and checks the result. This patch allows the
1989         suspendedState to be either State::Running or State::WillSuspend to
1990         account for this.
1991
1992         No new tests, this should fix http/wpt/service-workers/service-worker-spinning-fetch.https.html.
1993
1994         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
1995         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
1996         (WebKit::WebResourceLoadStatisticsStore::suspend):
1997
1998 2020-06-10  Alex Christensen  <achristensen@webkit.org>
1999
2000         Revert r259770
2001         https://bugs.webkit.org/show_bug.cgi?id=210097
2002         <rdar://problem/64175992>
2003
2004         * UIProcess/WebPageProxy.cpp:
2005         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2006
2007 2020-06-10  Alex Christensen  <achristensen@webkit.org>
2008
2009         Add some null checks in PDFPlugin::updatePageAndDeviceScaleFactors
2010         https://bugs.webkit.org/show_bug.cgi?id=213009
2011         <rdar://problem/63756100>
2012
2013         Reviewed by Chris Dumez.
2014
2015         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2016         (WebKit::PDFPlugin::updatePageAndDeviceScaleFactors):
2017
2018 2020-06-09  Fujii Hironori  <Hironori.Fujii@sony.com>
2019
2020         Unreviewed, reverting r262791.
2021
2022         WinCairo WebKit1 is crashing.
2023
2024         Reverted changeset:
2025
2026         "[Curl] Implement functions to use ResourceLoadStatistics."
2027         https://bugs.webkit.org/show_bug.cgi?id=207692
2028         https://trac.webkit.org/changeset/262791
2029
2030 2020-06-09  Tim Horton  <timothy_horton@apple.com>
2031
2032         Stop using the wrong LaunchServices SPI for getting an app's localized name
2033         https://bugs.webkit.org/show_bug.cgi?id=213003
2034         <rdar://problem/64169000>
2035
2036         Reviewed by Sam Weinig.
2037
2038         * UIProcess/ios/WKActionSheetAssistant.mm:
2039         (-[WKActionSheetAssistant _appendAppLinkOpenActionsForURL:actions:elementInfo:]):
2040
2041 2020-06-09  Mark Lam  <mark.lam@apple.com>
2042
2043         Disambiguate the OverridesGetPropertyNames structure flag
2044         https://bugs.webkit.org/show_bug.cgi?id=212909
2045         <rdar://problem/63823557>
2046
2047         Reviewed by Saam Barati.
2048
2049         * WebProcess/Plugins/Netscape/JSNPObject.h:
2050
2051 2020-06-09  Dean Jackson  <dino@apple.com>
2052
2053         Stop using discriminatory names for WebGL and Plugin blocking
2054         https://bugs.webkit.org/show_bug.cgi?id=213000
2055
2056         Reviewed by Simon Fraser.
2057
2058         * Shared/Plugins/Netscape/mac/PluginInformationMac.mm:
2059         (WebKit::getPlatformPluginModuleInformation):
2060         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
2061         (WKContextIsPlugInUpdateAvailable):
2062         (WKContextShouldBlockWebGL):
2063         (WKContextShouldSuggestBlockWebGL):
2064         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
2065         (WebKit::PluginInfoStore::defaultLoadPolicyForPlugin):
2066
2067 2020-06-09  Brian Burg  <bburg@apple.com>
2068
2069         [Cocoa] Element Send Keys can hang when an automation window becomes unfocused
2070         https://bugs.webkit.org/show_bug.cgi?id=212985
2071         <rdar://problem/56354471>
2072
2073         Reviewed by Devin Rousso.
2074
2075         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
2076         (WebKit::WebAutomationSession::sendSynthesizedEventsToPage):
2077         Make sure to focus the window and set first responder so sending keys doesn't hang.
2078
2079
2080 2020-06-09  Jonathan Bedard  <jbedard@apple.com>
2081
2082         WebKit: Import NSURLConnectionSPI.h instead of CFNSURLConnection.h
2083         https://bugs.webkit.org/show_bug.cgi?id=212980
2084         <rdar://problem/64172694>
2085
2086         Unreviewed build fix.
2087
2088         No new tests, behavior unchanged.
2089
2090         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2091
2092 2020-06-09  Dean Jackson  <dino@apple.com>
2093
2094         REGRESSION: [Safari Mojave for High Sierra] Accessing some of the featured pages on apple.com causes the webpage to crash
2095         https://bugs.webkit.org/show_bug.cgi?id=212940
2096
2097         Reviewed by Tim Horton.
2098
2099         The code to use the singleton for a SwitchingGPUClient was assuming it
2100         has always been set, which was not the case when
2101         ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) was not true.
2102
2103         * WebProcess/cocoa/WebProcessCocoa.mm: Set the singleton unconditionally.
2104         (WebKit::WebProcess::platformInitializeProcess):
2105
2106 2020-06-09  Wenson Hsieh  <wenson_hsieh@apple.com>
2107
2108         REGRESSION (r260820): [macCatalyst] Web process crashes when uploading a file
2109         https://bugs.webkit.org/show_bug.cgi?id=212976
2110         <rdar://problem/64033186>
2111
2112         Reviewed by Tim Horton.
2113
2114         On Mac Catalyst, we attempt to take a sandbox extension for `com.apple.frontboard.systemappservices` when
2115         uploading a file; this service does not exist in Catalyst, and we consequently encounter a release assertion
2116         under `WebPage::didChooseFilesForOpenPanelWithDisplayStringAndIcon`.
2117
2118         Fix this by introducing `HAVE(FRONTBOARD_SYSTEM_APP_SERVICES)`, and using it to guard codepaths that attempt to
2119         grab a mach extension to this service. (As a followup, we should consider adopting this in other places that
2120         currently reference `com.apple.frontboard.systemappservices`).
2121
2122         * UIProcess/WebPageProxy.cpp:
2123         (WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
2124         * WebProcess/WebPage/WebPage.cpp:
2125         (WebKit::WebPage::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
2126
2127 2020-06-09  Jonathan Bedard  <jbedard@apple.com>
2128
2129         WebKit: Support watchOS and tvOS in xcconfigs
2130         https://bugs.webkit.org/show_bug.cgi?id=212977
2131         <rdar://problem/64170532>
2132
2133         Reviewed by Tim Horton.
2134
2135         No new tests, behavior unchanged.
2136
2137         * Configurations/Base.xcconfig: Add tvOS and watchOS major version macros.
2138         * Configurations/BaseTarget.xcconfig: Include tvOS and watchOS framework stubs.
2139         * Configurations/BaseXPCService.xcconfig: Generalize excluded files for all embedded platforms.
2140         * Configurations/GPUService.xcconfig: Generalize INFOPLIST for embedded platforms.
2141         * Configurations/NetworkService.xcconfig: Ditto.
2142         * Configurations/WebContentService.xcconfig: Ditto.
2143
2144 2020-06-09  Alex Christensen  <achristensen@webkit.org>
2145
2146         Expose PDF file URL in shouldAllowPDFToOpenFromFrame SPI
2147         https://bugs.webkit.org/show_bug.cgi?id=212974
2148
2149         Reviewed by Tim Horton.
2150
2151         * UIProcess/API/APIUIClient.h:
2152         (API::UIClient::confirmPDFOpening):
2153         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2154         * UIProcess/Cocoa/UIDelegate.h:
2155         * UIProcess/Cocoa/UIDelegate.mm:
2156         (WebKit::UIDelegate::setDelegate):
2157         (WebKit::UIDelegate::UIClient::confirmPDFOpening):
2158         * UIProcess/mac/WebPageProxyMac.mm:
2159         (WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplication):
2160         (WebKit::WebPageProxy::openPDFFromTemporaryFolderWithNativeApplication):
2161
2162 2020-06-09  Takashi Komori  <Takashi.Komori@sony.com>
2163
2164         [Curl] Implement functions to use ResourceLoadStatistics.
2165         https://bugs.webkit.org/show_bug.cgi?id=207692
2166
2167         Reviewed by Don Olmstead.
2168
2169         Implement functions which are required to implement ResourceLoadStatistics for Curl port.
2170
2171         In NetworkDataTaskCurl.cpp we check if we should block cookies and block if needed.
2172
2173         Tests: http/tests/resourceLoadStatistics/
2174
2175         * NetworkProcess/NetworkDataTask.cpp:
2176         (WebKit::NetworkDataTask::create):
2177         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
2178         (WebKit::NetworkDataTaskCurl::NetworkDataTaskCurl):
2179         (WebKit::NetworkDataTaskCurl::createCurlRequest):
2180         (WebKit::NetworkDataTaskCurl::willPerformHTTPRedirection):
2181         (WebKit::NetworkDataTaskCurl::blockCookies):
2182         (WebKit::NetworkDataTaskCurl::unblockCookies):
2183         (WebKit::NetworkDataTaskCurl::shouldBlockCookies):
2184         (WebKit::NetworkDataTaskCurl::isThirdPartyRequest):
2185         * NetworkProcess/curl/NetworkDataTaskCurl.h:
2186         * NetworkProcess/curl/NetworkSessionCurl.cpp:
2187         (WebKit::NetworkSessionCurl::NetworkSessionCurl):
2188         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2189         (WKWebsiteDataStoreGetAllStorageAccessEntries):
2190         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
2191         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2192         (WebKit::WebsiteDataStore::parameters):
2193
2194 2020-06-09  Lauro Moura  <lmoura@igalia.com>
2195
2196         [WebDriver][WPE] Follow up WPE fix after r262703
2197         https://bugs.webkit.org/show_bug.cgi?id=212948
2198
2199         Reviewed by Carlos Garcia Campos.
2200
2201         Covered by existing tests.
2202
2203         * UIProcess/Automation/wpe/WebAutomationSessionWPE.cpp:
2204         (WebKit::WebAutomationSession::platformWebModifiersFromRaw):
2205
2206 2020-06-08  David Kilzer  <ddkilzer@apple.com>
2207
2208         [IPC] Adopt enum class for IPC::CFType
2209         <https://webkit.org/b/212921>
2210         <rdar://problem/64134506>
2211
2212         Reviewed by Darin Adler.
2213
2214         Summary:
2215         - Convert IPC::CFType to enum class.
2216         - Rule for new enum names is to remove "Ref" suffix from the
2217           actual type name.
2218         - Special enum CFType::Null renamed to CFType::Nullptr to
2219           differentiate from CFType::CFNull objects.
2220
2221         * Shared/cf/ArgumentCodersCF.cpp:
2222         (IPC::tokenNullTypeRef): Delete.
2223         (IPC::tokenNullptrTypeRef): Add.
2224         - Rename tokenNullTypeRef() to tokenNullptrTypeRef().
2225         (IPC::CFType):
2226         - Convert to enum class.
2227         (IPC::typeFromCFTypeRef):
2228         (IPC::encode):
2229         - Switch from encodeEnum() to operator<<().
2230         (IPC::decode):
2231         - Switch from decodeEnum() to decode().
2232         (WTF::EnumTraits<IPC::CFType>): Add.
2233         * Shared/cf/ArgumentCodersCF.h:
2234         (IPC::tokenNullTypeRef): Delete.
2235         (IPC::tokenNullptrTypeRef): Add.
2236         - Rename tokenNullTypeRef() to tokenNullptrTypeRef().
2237         * Shared/mac/WebCoreArgumentCodersMac.mm:
2238         (IPC::ArgumentCoder<WebCore::ResourceRequest>::encodePlatformData):
2239         (IPC::ArgumentCoder<WebCore::ResourceRequest>::decodePlatformData):
2240         - Switch to use tokenNullptrTypeRef().
2241         * mac/WebKit2.order:
2242         - Update symbol name after renaming tokenNullTypeRef().
2243
2244 2020-06-08  Kate Cheney  <katherine_cheney@apple.com>
2245
2246         ResourceLoadStatisticsDatabaseStore::domainIDFromString failed, error message: bad parameter or other API misuse
2247         https://bugs.webkit.org/show_bug.cgi?id=212916
2248         <rdar://problem/64127238>
2249
2250         Reviewed by Sihui Liu.
2251
2252         Make sure m_domainIDFromStringStatement is accessed in a separate
2253         scope in ensureResourceStatisticsForRegistrableDomain() so it will be
2254         reset before being used again.
2255
2256         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
2257         (WebKit::ResourceLoadStatisticsDatabaseStore::domainID const):
2258         Add debug assert to ensure that tests catch this case.
2259
2260         (WebKit::ResourceLoadStatisticsDatabaseStore::ensureResourceStatisticsForRegistrableDomain const):
2261
2262 2020-06-08  Chris Dumez  <cdumez@apple.com>
2263
2264         Turn some WebPageProxy logging into error logging
2265         https://bugs.webkit.org/show_bug.cgi?id=212922
2266         <rdar://problem/63894722>
2267
2268         Reviewed by Geoffrey Garen.
2269
2270         * UIProcess/WebPageProxy.cpp:
2271         (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
2272         (WebKit::WebPageProxy::didFailLoadForFrame):
2273         (WebKit::WebPageProxy::processDidTerminate):
2274         (WebKit::WebPageProxy::dispatchProcessDidTerminate):
2275         (WebKit::WebPageProxy::tryReloadAfterProcessTermination):
2276         (WebKit::WebPageProxy::didExceedInactiveMemoryLimitWhileActive):
2277         (WebKit::WebPageProxy::didExceedBackgroundCPULimitWhileInForeground):
2278
2279 2020-06-08  David Kilzer  <ddkilzer@apple.com>
2280
2281         [IPC] Adopt enum class for DragOperation
2282         <https://webkit.org/b/212870>
2283         <rdar://problem/64069940>
2284
2285         Reviewed by Darin Adler.
2286
2287         * Scripts/webkit/messages.py:
2288         - Remove FIXME now that it's not needed.
2289         * Shared/API/Cocoa/_WKDragActionsInternal.h:
2290         (WebKit::coreDragOperationMask):
2291         * UIProcess/Cocoa/WebViewImpl.mm:
2292         (WebKit::kit):
2293         * UIProcess/ios/WKContentViewInteraction.mm:
2294         (dropOperationForWebCoreDragOperation):
2295         (coreDragOperationForUIDropOperation):
2296         (-[WKContentView dragDataForDropSession:dragDestinationAction:]):
2297
2298 2020-06-08  Commit Queue  <commit-queue@webkit.org>
2299
2300         Unreviewed, reverting r262685.
2301         https://bugs.webkit.org/show_bug.cgi?id=212914
2302
2303         caused flakey crashes in an iOS test
2304
2305         Reverted changeset:
2306
2307         "Clear WebPageProxy event state between tests"
2308         https://bugs.webkit.org/show_bug.cgi?id=212864
2309         https://trac.webkit.org/changeset/262685
2310
2311 2020-06-08  Sam Weinig  <weinig@apple.com>
2312
2313         Extended Color: Unify rounding / clamping conversions between 0-1 float components and 0-255 byte components
2314         https://bugs.webkit.org/show_bug.cgi?id=212871
2315
2316         Reviewed by Simon Fraser.
2317
2318         * UIProcess/API/ios/WKWebViewIOS.mm:
2319         (scrollViewBackgroundColor):
2320         Replaces uses of colorWithAlphaUsingAlternativeRounding() with colorWithAlpha().
2321
2322 2020-06-08  Richard Houle  <rhoule@apple.com>
2323
2324         Links in NSAttributedString passed to -[WKWebView _showSafeBrowsingWarningWithURL:title:warning:details:completionHandler:] are ignored
2325         https://bugs.webkit.org/show_bug.cgi?id=212801
2326         <rdar://problem/63027631>
2327
2328         Reviewed by Alex Christensen.
2329
2330         * UIProcess/API/Cocoa/WKWebView.mm:
2331         (-[WKWebView _showSafeBrowsingWarningWithTitle:warning:details:completionHandler:]): Call the new detailsWithLinks
2332         implementation, asserting if an URL is non nil.
2333         (-[WKWebView _showSafeBrowsingWarningWithURL:title:warning:details:completionHandler:]): Ditto.
2334         (-[WKWebView _showSafeBrowsingWarningWithURL:title:warning:detailsWithLinks:completionHandler:]): Pass the URL to
2335         the completion handler when appropriate.
2336         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2337
2338 2020-06-08  Per Arne Vollan  <pvollan@apple.com>
2339
2340         [Cocoa] Adopt read-only mode for preferences in the WebContent process
2341         https://bugs.webkit.org/show_bug.cgi?id=212411
2342
2343         Reviewed by Darin Adler.
2344
2345         Change name of HAVE define to match SPI name.
2346
2347         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
2348         (WebKit::XPCServiceMain):
2349
2350 2020-06-08  Per Arne Vollan  <pvollan@apple.com>
2351
2352         [Cocoa] CFPrefs synchronization does not always work for global preference changes
2353         https://bugs.webkit.org/show_bug.cgi?id=212783
2354
2355         Reviewed by Tim Horton.
2356
2357         In CFPrefs direct mode, synchronization of global preference changes from the UI process to the WebContent process does not always work.
2358         This is caused by the KVO notification being sent to all or some of the NSUserDefault objects, which leads us to believe a non-global
2359         preference was changed. Since a global preference change always leads to some NSUserDefaults object receiving the notification, we can
2360         work around this by checking if the preference being changed really belongs to the domain of the NSUserDefaults object, or if it is a
2361         global preference. Also, stop creating NSUserDefaults object for the global domain, since this is an error according to the docs.
2362
2363         API test: WebKit.GlobalPreferenceChangesUsingDefaultsWrite
2364
2365         * UIProcess/Cocoa/PreferenceObserver.mm:
2366         (-[WKUserDefaults _notifyObserversOfChangeFromValuesForKeys:toValuesForKeys:]):
2367         * WebProcess/cocoa/WebProcessCocoa.mm:
2368         (WebKit::WebProcess::platformInitializeWebProcess):
2369         (WebKit::WebProcess::notifyPreferencesChanged):
2370
2371 2020-06-08  Wenson Hsieh  <wenson_hsieh@apple.com>
2372
2373         [iOS] Hit-testing on icloud.com is offset after closing a tab
2374         https://bugs.webkit.org/show_bug.cgi?id=212890
2375         <rdar://problem/58775297>
2376
2377         Reviewed by Simon Fraser.
2378
2379         After tapping to create a new tab on the icloud.com settings page (with no other tabs open) and then closing the
2380         new tab, all hit-testing on the page is offset by -33px until the page is reloaded. This bug appears to be a
2381         corner case triggered by a combination of the following three changes:
2382
2383         - <https://trac.webkit.org/r170463>
2384         - <https://trac.webkit.org/r245006>
2385         - <rdar://problem/53660458> (which is an iOS-specific Safari change)
2386
2387         We start on icloud.com's settings page. When closing the newly created tab, Safari hides the tab bar, causing
2388         both the top content inset and top obscured inset to decrease by 33 points. When applying the top content inset
2389         change, Safari (after <rdar://problem/53660458>) temporarily sets `_automaticContentOffsetAdjustmentEnabled` on
2390         `WKScrollView` to `NO`, which means that the scroll view doesn't automatically adjust its content offset to -70;
2391         instead, it remains at -103 (the content offset when the tab bar is shown).
2392
2393         Because of this, during the next remote layer tree commit where the content size changes,
2394         `-_setContentSizePreservingContentOffsetDuringRubberband:` will believe that we're currently rubber-banding by
2395         33px, and therefore try to adjust the content offset of the scroll view to be -103 instead of allowing it to be
2396         adjusted back to -70 (see r170463 and `-_restoreContentOffsetWithRubberbandAmount:`).
2397
2398         This results in the scroll position on the page (`document.scrollingElement.scrollTop`) reporting -33, even
2399         though the top of the page is flush with the bottom of Safari's browser chrome. Finally, because `WKScrollView`
2400         is made unscrollable due to `overflow: hidden;` (r245006), we end up permanently stuck in this state until the
2401         next page load, rather than the next remote layer tree commit that causes any scrolling.
2402
2403         To fix this, add an additional restriction on the rubberbanding offset restoration code in
2404         `-_setContentSizePreservingContentOffsetDuringRubberband:`, such that we only try to preserve the current
2405         rubberbanded offset if we're actually rubberbanding (that is, dragging or bouncing against the edge of the
2406         scroll view). Note that when rubberbanding against the top of the scroll view on iPad using a trackpad, the
2407         `-isDragging` property is also true, which matches behavior when panning via touch.
2408
2409         Test: ScrollViewInsetTests.ChangeInsetWithoutAutomaticAdjustmentWhileWebProcessIsUnresponsive
2410
2411         * Platform/spi/ios/UIKitSPI.h:
2412         * UIProcess/ios/WKScrollView.mm:
2413         (-[WKScrollView _setContentSizePreservingContentOffsetDuringRubberband:]):
2414
2415         Also, split out the `CGSizeEqualToSize(currentContentSize, contentSize)` case into a separate early return that
2416         skips the call to `-setContentSize:` altogether.
2417
2418 2020-06-08  Andy Estes  <aestes@apple.com>
2419
2420         [Apple Pay] Remove -respondsToSelector: check before calling -[PKPaymentRequest setBoundInterfaceIdentifier:]
2421         https://bugs.webkit.org/show_bug.cgi?id=212884
2422         <rdar://problem/64090963>
2423
2424         Reviewed by Youenn Fablet.
2425
2426         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2427         (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): Relied on the definition of
2428         HAVE_PASSKIT_BOUND_INTERFACE_IDENTIFIER to ensure that PKPaymentRequest will respond to
2429         -setBoundInterfaceIdentifier:.
2430
2431 2020-06-08  Andy Estes  <aestes@apple.com>
2432
2433         [Apple Pay] Remove ENABLE_APPLE_PAY_SETUP, ENABLE_APPLE_PAY_SESSION_V7, and HAVE_PASSKIT_PAYMENT_SETUP
2434         https://bugs.webkit.org/show_bug.cgi?id=212883
2435         <rdar://problem/64090763>
2436
2437         Reviewed by Youenn Fablet.
2438
2439         These macros evaluate to true whenever ENABLE(APPLE_PAY) is true on platforms supported by
2440         trunk WebKit, so we can either remove them or replace them with ENABLE(APPLE_PAY).
2441
2442         * Shared/ApplePay/ApplePayPaymentSetupFeatures.mm:
2443         * Shared/ApplePay/ApplePayPaymentSetupFeaturesWebKit.h:
2444         * Shared/ApplePay/PaymentSetupConfiguration.mm:
2445         * Shared/ApplePay/PaymentSetupConfigurationWebKit.h:
2446         * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
2447         * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in:
2448         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2449         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
2450         * WebProcess/ApplePay/WebPaymentCoordinator.h:
2451
2452 2020-06-08  youenn fablet  <youenn@apple.com>
2453
2454         [Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder
2455         https://bugs.webkit.org/show_bug.cgi?id=206582
2456         <rdar://problem/58985368>
2457
2458         Reviewed by Eric Carlson.
2459
2460         Enable RemoteMediaRecorder only for systems supporting AVAssetWriterDelegate.
2461
2462         * GPUProcess/GPUConnectionToWebProcess.cpp:
2463         (WebKit::GPUConnectionToWebProcess::didReceiveMessage):
2464         * GPUProcess/GPUConnectionToWebProcess.h:
2465         * GPUProcess/webrtc/RemoteMediaRecorder.cpp:
2466         * GPUProcess/webrtc/RemoteMediaRecorder.h:
2467         * GPUProcess/webrtc/RemoteMediaRecorder.messages.in:
2468         * GPUProcess/webrtc/RemoteMediaRecorderManager.cpp:
2469         * GPUProcess/webrtc/RemoteMediaRecorderManager.h:
2470         * GPUProcess/webrtc/RemoteMediaRecorderManager.messages.in:
2471         * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.h:
2472         * WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp:
2473         * WebProcess/GPU/webrtc/MediaRecorderPrivate.h:
2474         * WebProcess/GPU/webrtc/MediaRecorderProvider.cpp:
2475         (WebKit::MediaRecorderProvider::createMediaRecorderPrivate):
2476
2477 2020-06-07  Lauro Moura  <lmoura@igalia.com>
2478
2479         [WebDriver] Allow platform-dependent modifier keys conversion to WebEvent::Modifier
2480         https://bugs.webkit.org/show_bug.cgi?id=212848
2481
2482         Reviewed by Brian Burg.
2483
2484         WebEvent::Modifier flags does not map directly to the platform flags,
2485         so we can't directly convert the modifier flags to the OptionSet.
2486
2487         Covered by existing WebDriver tests.
2488
2489         * UIProcess/Automation/WebAutomationSession.cpp:
2490         (WebKit::WebAutomationSession::simulateMouseInteraction): Use
2491         platform-specific method to convert the modifiers.
2492         * UIProcess/Automation/WebAutomationSession.h:
2493         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp: Added
2494         conversion from GDK modifier mask to WebEvent::Modifier.
2495         (WebKit::WebAutomationSession::platformWebModifiersFromRaw):
2496         * UIProcess/Automation/mac/WebAutomationSessionMac.mm: Added
2497         conversion from NSModifierFlag to WebEvent::Modifier.
2498         (WebKit::WebAutomationSession::platformWebModifiersFromRaw):
2499         * UIProcess/Automation/wpe/WebAutomationSessionWPE.cpp: Added
2500         conversion from wpe_input_keyboard_modifier to WebEvent::Modifier.
2501         (WebKit::WebAutomationSession::platformWebModifiersFromRaw):
2502
2503 2020-06-07  Lauro Moura  <lmoura@igalia.com>
2504
2505         [WPE] Behave like GDK_CURRENT_TIME when the timestamp is zero
2506         https://bugs.webkit.org/show_bug.cgi?id=212797
2507
2508         WebDriver tests come with zero timestamp. So behave like
2509         GDK_CURRENT_TIME and assume zero timestamp == WallTime::now().
2510
2511         Reviewed by Carlos Garcia Campos.
2512
2513         Covered by existing tests.
2514
2515         * Shared/libwpe/WebEventFactory.cpp:
2516         (WebKit::wallTimeForEventTime):
2517
2518 2020-06-07  Philippe Normand  <pnormand@igalia.com>
2519
2520         Remove ENABLE_VIDEO_TRACK ifdef guards
2521         https://bugs.webkit.org/show_bug.cgi?id=212568
2522
2523         Reviewed by Youenn Fablet.
2524
2525         * Configurations/FeatureDefines.xcconfig:
2526         * GPUProcess/GPUConnectionToWebProcess.cpp:
2527         (WebKit::GPUConnectionToWebProcess::dispatchMessage):
2528         * GPUProcess/GPUConnectionToWebProcess.h:
2529         * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
2530         (WebKit::RemoteMediaPlayerProxy::textTrackSetMode):
2531         (WebKit::RemoteMediaPlayerProxy::notifyTrackModeChanged):
2532         * GPUProcess/media/RemoteMediaPlayerProxy.h:
2533         * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer.cpp:
2534         * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer.h:
2535         * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer.messages.in:
2536         * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRendererManager.cpp:
2537         * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRendererManager.h:
2538         * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRendererManager.messages.in:
2539         * GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.cpp:
2540         * GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.h:
2541         * GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.messages.in:
2542         * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.cpp:
2543         * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.h:
2544         * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.messages.in:
2545         * Shared/WebPreferences.yaml:
2546         * WebProcess/GPU/GPUProcessConnection.cpp:
2547         (WebKit::GPUProcessConnection::dispatchMessage):
2548         * WebProcess/GPU/GPUProcessConnection.h:
2549         * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
2550         (WebKit::MediaPlayerPrivateRemote::tracksChanged):
2551         * WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
2552         * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
2553         (WebKit::RemoteMediaPlayerManager::updatePreferences):
2554         * WebProcess/GPU/webrtc/AudioMediaStreamTrackRenderer.cpp:
2555         * WebProcess/GPU/webrtc/AudioMediaStreamTrackRenderer.h:
2556         * WebProcess/GPU/webrtc/SampleBufferDisplayLayer.cpp:
2557         * WebProcess/GPU/webrtc/SampleBufferDisplayLayer.h:
2558         * WebProcess/GPU/webrtc/SampleBufferDisplayLayer.messages.in:
2559         * WebProcess/GPU/webrtc/SampleBufferDisplayLayerManager.cpp:
2560         * WebProcess/GPU/webrtc/SampleBufferDisplayLayerManager.h:
2561         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2562         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2563         * WebProcess/Network/WebLoaderStrategy.cpp:
2564         (WebKit::maximumBufferingTime):
2565
2566 2020-06-06  Simon Fraser  <simon.fraser@apple.com>
2567
2568         Clear WebPageProxy event state between tests
2569         https://bugs.webkit.org/show_bug.cgi?id=212864
2570
2571         Reviewed by Anders Carlsson.
2572
2573         Make sure that event state doesn't leak between tests via events queued in WebPageProxy.
2574
2575         * UIProcess/API/C/WKPage.cpp:
2576         (WKPageClearEventState):
2577         * UIProcess/API/C/WKPage.h:
2578         * UIProcess/WebPageProxy.cpp:
2579         (WebKit::WebPageProxy::resetStateAfterProcessExited):
2580         (WebKit::WebPageProxy::clearEventState):
2581         * UIProcess/WebPageProxy.h:
2582
2583 2020-06-06  Rob Buis  <rbuis@igalia.com>
2584
2585         Move URL scheme check to NetworkLoadChecker
2586         https://bugs.webkit.org/show_bug.cgi?id=191924
2587
2588         Reviewed by Joseph Pecoraro.
2589
2590         Reduce includes for CustomHeaderFields, I guess these were needed
2591         at some point but not anymore.
2592
2593         * Shared/WebsitePoliciesData.cpp:
2594
2595 2020-06-06  David Kilzer  <ddkilzer@apple.com>
2596
2597         Use OptionSet<DragOperation> for mask values
2598         <https://webkit.org/b/212605>
2599
2600         Reviewed by Darin Adler.
2601
2602         In broad strokes:
2603         - Replace use of DragOperation with OptionSet<DragOperation> or
2604           Optional<DragOperation>.
2605         - Rename function parameters and local variables to denote use
2606           of mask values.
2607         - Remove DragOperationNone enum value.
2608         - Replace DragOperationEvery enum value with anyDragOperation().
2609
2610         * Platform/spi/ios/UIKitSPI.h:
2611         (UIDragOperation):
2612         - Remove unused (and misnamed) UIDragOperation enum typedef.
2613         * Scripts/webkit/messages.py:
2614         (types_that_cannot_be_forward_declared):
2615         (headers_for_type):
2616         - Add support for WebCore::DragOperation enum.
2617         * Shared/API/Cocoa/_WKDragActionsInternal.h:
2618         (WebKit::coreDragOperationMask): Add conversion function.
2619         * Shared/WebCoreArgumentCoders.cpp:
2620         (IPC::ArgumentCoder<DragData>::encode):
2621         (IPC::ArgumentCoder<DragData>::decode):
2622         - Update to encode/decode OptionSet<DragOperation>.
2623
2624         * UIProcess/API/gtk/DragSource.h:
2625         (WebKit::DragSource::begin):
2626         * UIProcess/API/gtk/DragSourceGtk3.cpp:
2627         (WebKit::DragSource::begin):
2628         * UIProcess/API/gtk/DragSourceGtk4.cpp:
2629         (WebKit::DragSource::begin):
2630         * UIProcess/API/gtk/DropTarget.h:
2631         * UIProcess/API/gtk/DropTargetGtk3.cpp:
2632         (WebKit::DropTarget::didPerformAction):
2633         (WebKit::DropTarget::leaveTimerFired):
2634         * UIProcess/API/gtk/DropTargetGtk4.cpp:
2635         (WebKit::DropTarget::DropTarget):
2636         (WebKit::DropTarget::didPerformAction):
2637         * UIProcess/API/gtk/PageClientImpl.cpp:
2638         (WebKit::PageClientImpl::startDrag):
2639         * UIProcess/API/gtk/PageClientImpl.h:
2640         (WebKit::PageClientImpl::startDrag):
2641         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2642         (webkitWebViewBaseStartDrag):
2643         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
2644         (webkitWebViewBaseStartDrag):
2645
2646         * UIProcess/Cocoa/WebViewImpl.mm:
2647         (WebKit::WebViewImpl::sendDragEndToPage):
2648         (WebKit::WebViewImpl::draggingEntered):
2649         (WebKit::kit): Add conversion function.
2650         (WebKit::WebViewImpl::draggingUpdated):
2651         (WebKit::WebViewImpl::draggingExited):
2652         (WebKit::WebViewImpl::performDragOperation):
2653         - Make use of coreDragOperationMask() conversion function.
2654         * UIProcess/PageClient.h:
2655         (WebKit::WebViewImpl::startDrag):
2656         * UIProcess/WebPageProxy.cpp:
2657         (WebKit::WebPageProxy::didPerformDragControllerAction):
2658         - Remove MESSAGE_CHECK now that we're using the actual type.
2659         (WebKit::WebPageProxy::startDrag):
2660         (WebKit::WebPageProxy::dragEnded):
2661         (WebKit::WebPageProxy::resetCurrentDragInformation):
2662         * UIProcess/WebPageProxy.h:
2663         (WebKit::WebPageProxy::didPerformDragControllerAction):
2664         (WebKit::WebPageProxy::dragEnded):
2665         (WebKit::WebPageProxy::startDrag):
2666         (WebKit::WebPageProxy::currentDragOperation const):
2667         * UIProcess/WebPageProxy.messages.in:
2668         (WebPageProxy::DidPerformDragControllerAction):
2669         (WebPageProxy::StartDrag):
2670         * UIProcess/ios/WKContentViewInteraction.mm:
2671         (-[WKContentView _didHandleDragStartRequest:]):
2672         (dropOperationForWebCoreDragOperation):
2673         (coreDragOperationForUIDropOperation): Add conversion function.
2674         - Note that this was not being converted from UIDropOperation to
2675           WebCore::DragOperation previously, and UIDropOperationMove
2676           (0x3) was not being properly converted to DragOperationMove
2677           (0x16).
2678         (-[WKContentView dragDataForDropSession:dragDestinationAction:]):
2679         (-[WKContentView _didPerformDragOperation:]):
2680         (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
2681         (-[WKContentView dragInteraction:session:didEndWithOperation:]):
2682         (-[WKContentView dropInteraction:sessionDidEnd:]):
2683         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
2684         (WebKit::WebDragClient::startDrag):
2685         * WebProcess/WebPage/WebPage.cpp:
2686         (WebKit::WebPage::performDragControllerAction):
2687         (WebKit::WebPage::dragEnded):
2688         * WebProcess/WebPage/WebPage.h:
2689         (WebKit::WebPage::performDragControllerAction):
2690         (WebKit::WebPage::dragEnded):
2691         * WebProcess/WebPage/WebPage.messages.in:
2692         (WebPage::PerformDragControllerAction):
2693         (WebPage::DragEnded):
2694         * WebProcess/WebPage/ios/WebPageIOS.mm:
2695         (WebKit::WebPage::requestAdditionalItemsForDragSession):
2696
2697 2020-06-06  Devin Rousso  <drousso@apple.com>
2698
2699         Web Inspector: unify the naming scheme for agents used by instrumentation
2700         https://bugs.webkit.org/show_bug.cgi?id=212859
2701
2702         Reviewed by Timothy Hatcher.
2703
2704         Inspector agents fall into one of three categories:
2705          - "persistent" when Web Inspector is connected
2706          - "enabled" when that agent is `enable`d, such as if the corresponding tab is visible
2707          - "tracking" when that agent is part of a timeline recording.
2708
2709         The only exception to this is the Console agent, as that exists regardless of whether Web
2710         Inspector is connected as it needs to preserve messages logged before Web Inspector connects.
2711
2712         Also remove the "Inspector" prefix from getter/setter methods as it adds confusion if that
2713         agent also has subclasses (e.g. `InspectorRuntimeAgent` and `PageRuntimeAgent`).
2714
2715         * UIProcess/Inspector/Agents/InspectorBrowserAgent.cpp:
2716         * UIProcess/Inspector/WebInspectorProxy.cpp:
2717         * UIProcess/Inspector/WebPageInspectorController.h:
2718         Simple naming changes elided to avoid a long ChangeLog.
2719
2720 2020-06-05  David Kilzer  <ddkilzer@apple.com>
2721
2722         [IPC] Adopt enum class for AutocapitalizeType
2723         <https://webkit.org/b/212846>
2724         <rdar://problem/64042825>
2725
2726         Reviewed by Darin Adler.
2727
2728         Summary:
2729         - Move AutocapitalizeType into WebCore namespace.
2730         - Convert AutocapitalizeType to an enum class.
2731         - Add WTF::EnumTraits<AutocapitalizeType> for IPC.
2732
2733         * Shared/FocusedElementInformation.cpp:
2734         (WebKit::FocusedElementInformation::encode const):
2735         (WebKit::FocusedElementInformation::decode):
2736         - Stop using decodeEnum() and encodeEnum() now that
2737           WTF::EnumTraits<AutocapitalizeType> exists.
2738         * Shared/FocusedElementInformation.h:
2739         * Shared/glib/InputMethodState.cpp:
2740         (WebKit::InputMethodState::addHintsForAutocapitalizeType):
2741         * Shared/glib/InputMethodState.h:
2742         * UIProcess/ios/WKContentViewInteraction.mm:
2743         (toUITextAutocapitalize):
2744         * WebProcess/WebPage/ios/WebPageIOS.mm:
2745         (WebKit::WebPage::getFocusedElementInformation):
2746
2747 2020-06-05  Brent Fulgham  <bfulgham@apple.com>
2748
2749         [iOS] Silence telemetry generated during download operations
2750         https://bugs.webkit.org/show_bug.cgi?id=212854
2751         <rdar://problem/63909414>
2752
2753         Reviewed by Per Arne Vollan.
2754
2755         Remove reporting and telemetry for the 'com.apple.ProgressReporting' service
2756         from the Network Process sandbox, since this is a critical part of supplying
2757         download status to the WebKit UI.
2758
2759         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
2760
2761 2020-06-05  Ryan Haddad  <ryanhaddad@apple.com>
2762
2763         Unreviewed, reverting r262619, r262625, and r262641.
2764
2765         Caused mediarecorder layout test crashes.
2766
2767         Reverted changesets:
2768
2769         "[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder"
2770         https://bugs.webkit.org/show_bug.cgi?id=206582
2771         https://trac.webkit.org/changeset/262619
2772
2773         "[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder"
2774         https://bugs.webkit.org/show_bug.cgi?id=206582
2775         https://trac.webkit.org/changeset/262625
2776
2777         "Unreviewed, silence deprecation warning to fix build with
2778         latest SDK."
2779         https://trac.webkit.org/changeset/262641
2780
2781 2020-06-05  Kate Cheney  <katherine_cheney@apple.com>
2782
2783         ITP SQLite Database should only vacuum once per day
2784         https://bugs.webkit.org/show_bug.cgi?id=212712
2785         <rdar://problem/63939711>
2786
2787         Reviewed by Brent Fulgham.
2788
2789         Followup to https://trac.webkit.org/changeset/262538/webkit. We should
2790         run incremental auto vacuum, not a full vacuum, once per-day, because
2791         it is less expensive.
2792
2793         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
2794         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
2795         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
2796         (WebKit::WebResourceLoadStatisticsStore::performDailyTasks):
2797
2798 2020-06-05  Daniel Bates  <dabates@apple.com>
2799
2800         -_focusTextInputContext should reposition the caret if called for an already focused text input context
2801         https://bugs.webkit.org/show_bug.cgi?id=212830
2802         <rdar://problem/64032956>
2803
2804         Reviewed by Wenson Hsieh.
2805
2806         Update the code based on new feedback: the caret should now be re-positioned when -_focusTextInputContext
2807         is called on an already assisted text input context.
2808
2809         * UIProcess/ios/WKContentViewInteraction.h:
2810         * UIProcess/ios/WKContentViewInteraction.mm:
2811         (-[WKContentView cleanUpInteraction]):
2812         (-[WKContentView _didCommitLoadForMainFrame]): Reset state. See below for why.
2813
2814         (-[WKContentView _focusTextInputContext:placeCaretAt:completionHandler:]): I cannot simply remove the early
2815         return in -_focusTextInputContext that detects if the specified text input context is already focused because
2816         it could effect user-visible responsiveness due to an Apple internal client invoking this function more times
2817         than necessary with the same point during a text interaction. See <rdar://problem/59430806>. That radar
2818         represents a correctness issue. I didn't actually evaluate whether responsiveness is affected by this patch,
2819         but I would feel more confident that there would be 0 impact when removing the early branch after that radar
2820         is fixed without the need to even perform a responsiveness analysis. Note that there is already a comment about
2821         that radar at the top of this function.
2822
2823 2020-06-05  Alex Christensen  <achristensen@webkit.org>
2824
2825         Fix PDF opening after r262592
2826         https://bugs.webkit.org/show_bug.cgi?id=212795
2827
2828         * UIProcess/mac/WebPageProxyMac.mm:
2829         (WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplication):
2830         (WebKit::WebPageProxy::openPDFFromTemporaryFolderWithNativeApplication):
2831         As Darin mentioned and I was about to discover, my last-minute switching things around got the boolean condition backwards.
2832         We want to do nothing if we're not allowed to open the PDF, and we want to open the PDF if we are allowed to.s
2833
2834 2020-06-05  David Kilzer  <ddkilzer@apple.com>
2835
2836         [IPC] Adopt enum class for PluginLoadClientPolicy
2837         <https://webkit.org/b/212827>
2838         <rdar://problem/64030431>
2839
2840         Reviewed by Alex Christensen.
2841
2842         Summary:
2843         - Update for renamed PluginLoadClientPolicy enums.
2844         - Update to make PluginLoadClientPolicy type work with IPC.
2845         - Replace uint8_t with strongly-typed PluginLoadClientPolicy.
2846
2847         * Scripts/webkit/messages.py:
2848         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
2849         (WebKit::NetscapePluginModule::getPluginInfo):
2850         * Shared/WebProcessCreationParameters.h:
2851         * UIProcess/API/C/WKAPICast.h:
2852         (WebKit::toWKPluginLoadClientPolicy):
2853         (WebKit::toPluginLoadClientPolicy):
2854         * UIProcess/API/Cocoa/WKProcessPool.mm:
2855         (toPluginLoadClientPoliciesHashMap):
2856         (policiesHashMapToDictionary):
2857         (isPluginLoadClientPolicyAcceptable): Delete.
2858         - Replace with
2859           WTF::isValidEnum<WebCore::PluginLoadClientPolicy>().
2860         * UIProcess/WebProcessPool.cpp:
2861         (WebKit::WebProcessPool::setPluginLoadClientPolicy):
2862         (WebKit::WebProcessPool::resetPluginLoadClientPolicies):
2863         * UIProcess/WebProcessPool.h:
2864         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2865         (WebKit::PDFPlugin::pluginInfo):
2866         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
2867         (WebKit::WebPluginInfoProvider::webVisiblePluginInfo):
2868         * WebProcess/WebProcess.cpp:
2869         (WebKit::WebProcess::setPluginLoadClientPolicy):
2870         (WebKit::WebProcess::resetPluginLoadClientPolicies):
2871         * WebProcess/WebProcess.h:
2872         * WebProcess/WebProcess.messages.in:
2873
2874 2020-06-05  Alex Christensen  <achristensen@webkit.org>
2875
2876         Update header documentation for WKPreferences.fraudulentWebsiteWarningEnabled
2877         https://bugs.webkit.org/show_bug.cgi?id=212843
2878         <rdar://problem/64010164>
2879
2880         Reviewed by Geoffrey Garen.
2881
2882         * UIProcess/API/Cocoa/WKPreferences.h:
2883
2884 2020-06-05  Brent Fulgham  <bfulgham@apple.com>
2885
2886         [iOS] Remove message filtering telemetry for expected case
2887         https://bugs.webkit.org/show_bug.cgi?id=212841
2888         <rdar://problem/63893460>
2889
2890         Reviewed by Per Arne Vollan.
2891
2892         Remove unintentional telemetry being captured for expected behavior.
2893
2894         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2895
2896 2020-06-05  Per Arne Vollan  <pvollan@apple.com>
2897
2898         [Cocoa] Adopt read-only mode for preferences in the WebContent process
2899         https://bugs.webkit.org/show_bug.cgi?id=212411
2900         <rdar://problem/63640788>
2901
2902         Reviewed by Darin Adler.
2903
2904         The WebContent process should never write preferences. Adopt read-only mode for preferences.
2905         This will fix some sandbox violations when the UI process is notifying the WebContent process
2906         about preference changes. When notified, the WebContent process will use the preferences API
2907         to write those preferences in-process, but there should be no attempt at writing these new
2908         values to disk, which this patch will ensure.
2909
2910         No new tests, since this is fixing a benign sandbox violation.
2911
2912         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
2913         (WebKit::XPCServiceMain):
2914
2915 2020-06-05  Per Arne Vollan  <pvollan@apple.com>
2916
2917         [iOS] Fix message filter sandbox violation
2918         https://bugs.webkit.org/show_bug.cgi?id=212837
2919         <rdar://problem/63830368>
2920
2921         Reviewed by Darin Adler.
2922
2923         Add required message to message filter in the iOS WebContent sandbox.
2924
2925         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2926
2927 2020-06-05  Peng Liu  <peng.liu6@apple.com>
2928
2929         REGRESSION (r262456?): [macOS] media/picture-in-picture/picture-in-picture-api tests are flaky timeouts
2930         https://bugs.webkit.org/show_bug.cgi?id=212762
2931
2932         Reviewed by Eric Carlson.
2933
2934         The Picture-in-Picture implementation expects the two callbacks HTMLVideoElement::didBecomeFullscreenElement()
2935         and HTMLVideoElement::setVideoFullscreenFrame() to come in order. So we need to remove the dispatch_async()
2936         and call HTMLVideoElement::didBecomeFullscreenElement() directly.
2937
2938         * WebProcess/cocoa/VideoFullscreenManager.mm:
2939         (WebKit::VideoFullscreenManager::didEnterFullscreen):
2940
2941 2020-06-05  Adrian Perez de Castro  <aperez@igalia.com>
2942
2943         Non-unified build fixes, early summer 2020 edition
2944         https://bugs.webkit.org/show_bug.cgi?id=212819
2945
2946         Unreviewed build fix.
2947
2948         * Shared/gtk/NativeWebMouseEventGtk.cpp:
2949         (WebKit::NativeWebMouseEvent::NativeWebMouseEvent): Add missing WebCore:: namespace to
2950         a couple of uses of WebCore::FloatSize.
2951         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp: Add missing Logging.h header.
2952
2953 2020-06-05  Andy Estes  <aestes@apple.com>
2954
2955         [Apple Pay] Remove conditionals for ENABLE_APPLE_PAY_SESSION_V(3|4)
2956         https://bugs.webkit.org/show_bug.cgi?id=212541
2957         <rdar://problem/63781452>
2958
2959         Reviewed by Darin Adler.
2960
2961         APPLE_PAY_SESSION_V(3|4) is now enabled whenever APPLE_PAY itself is enabled.
2962
2963         * Configurations/FeatureDefines.xcconfig:
2964
2965 2020-06-05  youenn fablet  <youenn@apple.com>
2966
2967         [Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder
2968         https://bugs.webkit.org/show_bug.cgi?id=206582
2969         <rdar://problem/58985368>
2970
2971         Reviewed by Eric Carlson.
2972
2973         Enable RemoteMediaRecorder only for systems supporting AVAssetWriterDelegate.
2974
2975         * GPUProcess/GPUConnectionToWebProcess.cpp:
2976         (WebKit::GPUConnectionToWebProcess::didReceiveMessage):
2977         * GPUProcess/GPUConnectionToWebProcess.h:
2978         * GPUProcess/webrtc/RemoteMediaRecorder.cpp:
2979         * GPUProcess/webrtc/RemoteMediaRecorder.h:
2980         * GPUProcess/webrtc/RemoteMediaRecorder.messages.in:
2981         * GPUProcess/webrtc/RemoteMediaRecorderManager.cpp:
2982         * GPUProcess/webrtc/RemoteMediaRecorderManager.h:
2983         * GPUProcess/webrtc/RemoteMediaRecorderManager.messages.in:
2984         * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.h:
2985         * WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp:
2986         * WebProcess/GPU/webrtc/MediaRecorderPrivate.h:
2987         * WebProcess/GPU/webrtc/MediaRecorderProvider.cpp:
2988         (WebKit::MediaRecorderProvider::createMediaRecorderPrivate):
2989
2990 2020-06-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2991
2992         REGRESSION(r262184): [GTK] Two fast/forms tests are crashing
2993         https://bugs.webkit.org/show_bug.cgi?id=212747
2994
2995         Reviewed by Adrian Perez de Castro.
2996
2997         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
2998         (WebKit::WebPopupMenuProxyGtk::handleKeyPress): Return early if the menu has already been closed.
2999
3000 2020-06-05  Youenn Fablet  <youenn@apple.com>
3001
3002         Generate code to set the runtime settings for a service worker process
3003         https://bugs.webkit.org/show_bug.cgi?id=212467
3004
3005         Reviewed by Alex Christensen.
3006
3007         Split the code generated to handle web preference changes to have one method for process wide flags and one for page settings.
3008         Make the process wide flag method static and reuse it in WebSWContextManagerConnection.
3009         Covered by existing tests.
3010
3011         * Scripts/PreferencesTemplates/WebPageUpdatePreferences.cpp.erb:
3012         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
3013         (WebKit::WebSWContextManagerConnection::updatePreferencesStore):
3014         * WebProcess/WebPage/WebPage.cpp:
3015         (WebKit::WebPage::updatePreferences):
3016         * WebProcess/WebPage/WebPage.h:
3017
3018 2020-06-04  David Kilzer  <ddkilzer@apple.com>
3019
3020         [IPC] Adopt enum class for PluginProcessType and PluginProcessSandboxPolicy
3021         <https://webkit.org/b/212758>
3022
3023         Reviewed by Darin Adler.
3024
3025         * PluginProcess/mac/PluginProcessMac.mm:
3026         (WebKit::PluginProcess::platformInitializePluginProcess):
3027         * Scripts/webkit/messages.py:
3028         * Shared/Plugins/PluginProcessAttributes.h:
3029         (WebKit::PluginProcessType): Convert to enum class.
3030         (WebKit::PluginProcessSandboxPolicy): Ditto.
3031         * UIProcess/Plugins/PluginProcessManager.cpp:
3032         (WebKit::PluginProcessManager::fetchWebsiteData):
3033         (WebKit::PluginProcessManager::deleteWebsiteData):
3034         (WebKit::PluginProcessManager::deleteWebsiteDataForHostNames):
3035         * UIProcess/Plugins/PluginProcessProxy.cpp:
3036         (WebKit::PluginProcessProxy::didFinishLaunching):
3037         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
3038         (WebKit::PluginProcessProxy::platformGetLaunchOptionsWithAttributes):
3039         * UIProcess/WebPageProxy.cpp:
3040         (WebKit::WebPageProxy::findPlugin):
3041         * UIProcess/WebPageProxy.h:
3042         * UIProcess/WebPageProxy.messages.in:
3043         * WebProcess/WebPage/WebPage.cpp:
3044         (WebKit::WebPage::createPlugin):
3045         (WebKit::WebPage::canPluginHandleResponse):
3046
3047 2020-06-04  Alex Christensen  <achristensen@webkit.org>
3048
3049         Add WKUIDelegate SPI to confirm before opening a PDF
3050         https://bugs.webkit.org/show_bug.cgi?id=212795
3051         <rdar://problem/58715847>
3052
3053         Reviewed by Tim Horton.
3054
3055         * UIProcess/API/APIUIClient.h:
3056         (API::UIClient::confirmPDFOpening):
3057         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3058         * UIProcess/Cocoa/UIDelegate.h:
3059         * UIProcess/Cocoa/UIDelegate.mm:
3060         (WebKit::UIDelegate::setDelegate):
3061         (WebKit::UIDelegate::UIClient::confirmPDFOpening):
3062         * UIProcess/WebPageProxy.h:
3063         * UIProcess/WebPageProxy.messages.in:
3064         * UIProcess/ios/WebPageProxyIOS.mm:
3065         (WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplication):
3066         (WebKit::WebPageProxy::openPDFFromTemporaryFolderWithNativeApplication):
3067         * UIProcess/mac/WebPageProxyMac.mm:
3068         (WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplication):
3069         (WebKit::WebPageProxy::openPDFFromTemporaryFolderWithNativeApplication):
3070         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3071         (WebKit::PDFPlugin::openWithNativeApplication):
3072         * WebProcess/WebPage/WebPage.cpp:
3073         (WebKit::WebPage::savePDFToTemporaryFolderAndOpenWithNativeApplication):
3074         * WebProcess/WebPage/WebPage.h:
3075
3076 2020-06-04  Chris Dumez  <cdumez@apple.com>
3077
3078         UIProcess may crash after its prewarmed WebProcess gets terminated
3079         https://bugs.webkit.org/show_bug.cgi?id=212790
3080         <rdar://problem/63696191>
3081
3082         Reviewed by Geoffrey Garen.
3083
3084         Query WebProcessProxy::isDummyProcessProxy() because trying to look up the process
3085         in m_dummyProcessProxies. The key for m_dummyProcessProxies is a sessionID but
3086         not all processes have a sessionID. In particular, prewarmed web processes have
3087         no associated WebsiteDataStore and thus not sessionID.
3088
3089         * UIProcess/WebProcessPool.cpp:
3090         (WebKit::WebProcessPool::disconnectProcess):
3091
3092 2020-06-04  Brent Fulgham  <bfulgham@apple.com>
3093
3094         Reduce telemetry and report generation for WebContent Process sandbox
3095         https://bugs.webkit.org/show_bug.cgi?id=212779
3096         <rdar://problem/63769879>
3097
3098         Reviewed by Per Arne Vollan.
3099
3100         This patch cleans up a set of telemetry and reports generated during normal
3101         WebKit operation. Now that we understand the uses of these XPC services, we
3102         can reduce the logging traffic.
3103
3104         This is important to do now, since generating the telemetry and reports has
3105         a non-zero power cost.
3106
3107         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3108         * WebProcess/com.apple.WebProcess.sb.in:
3109
3110 2020-06-04  Jiewen Tan  <jiewen_tan@apple.com>
3111
3112         Disable CFNetwork AppSSO interception for Mac Catalyst
3113         https://bugs.webkit.org/show_bug.cgi?id=212787
3114         <rdar://problem/63738783>
3115
3116         Reviewed by Chris Dumez.
3117
3118         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3119         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
3120
3121 2020-06-04  Brent Fulgham  <bfulgham@apple.com>
3122
3123         Reduce telemetry and report generation for Network Process sandbox
3124         https://bugs.webkit.org/show_bug.cgi?id=212778
3125         <rdar://problem/63891745>
3126
3127         Reviewed by Per Arne Vollan.
3128
3129         This patch cleans up a set of telemetry and reports generated during normal
3130         WebKit operation. Now that we understand the uses of these XPC services, we
3131         can reduce the logging traffic.
3132
3133         This is important to do now, since telemetry and report generation has
3134         battery life and performance impact.
3135
3136         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
3137         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
3138
3139 2020-06-04  Jacob Uphoff  <jacob_uphoff@apple.com>
3140
3141         Unreviewed, reverting r262546.
3142
3143         This commit caused internal build failures
3144
3145         Reverted changeset:
3146
3147         "[Cocoa] Adopt read-only mode for preferences in the
3148         WebContent process"
3149         https://bugs.webkit.org/show_bug.cgi?id=212411
3150         https://trac.webkit.org/changeset/262546
3151
3152 2020-06-04  Chris Dumez  <cdumez@apple.com>
3153
3154         [iOS] Drop DependentProcessLink ProcessAssertion as it creates power leaks
3155         https://bugs.webkit.org/show_bug.cgi?id=212768
3156         <rdar://problem/62408828>
3157
3158         Reviewed by Alex Christensen.
3159
3160         Drop DependentProcessLink ProcessAssertion since it creates a process assertion cycle between
3161         the UIProcess and the WebContent process and leads to power leaks.
3162
3163         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3164         * Shared/WebProcessCreationParameters.cpp:
3165         (WebKit::WebProcessCreationParameters::encode const):
3166         (WebKit::WebProcessCreationParameters::decode):
3167         * Shared/WebProcessCreationParameters.h:
3168         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3169         (WebKit::WebProcessPool::platformInitializeWebProcess):
3170         * UIProcess/ProcessAssertion.h:
3171         * UIProcess/ProcessThrottler.cpp:
3172         (WebKit::ProcessThrottler::assertionName const):
3173         * UIProcess/WebProcessProxy.cpp:
3174         (WebKit::WebProcessProxy::didSetAssertionType):
3175         * UIProcess/ios/ProcessAssertionIOS.mm:
3176         (WebKit::runningBoardNameForAssertionType):
3177         (WebKit::flagsForAssertionType):
3178         (WebKit::toBKSProcessAssertionReason):
3179         * WebProcess/WebProcess.h:
3180         * WebProcess/cocoa/WebProcessCocoa.mm:
3181         (WebKit::WebProcess::platformInitializeWebProcess):
3182
3183 2020-06-04  Brent Fulgham  <bfulgham@apple.com>
3184
3185         Revise sandbox to support network stack telemetry without sandbox violation reports
3186         https://bugs.webkit.org/show_bug.cgi?id=212720
3187         <rdar://problem/63895783>
3188
3189         Reviewed by Per Arne Vollan.
3190
3191         Telemetry captured for various networking configurations has revealed a handful of mach service
3192         connections that should be allowed in the Network Process to support troubleshooting and field diagnostics.
3193
3194         This patch revises the sandbox to avoid logging these accesses during normal operation.
3195
3196         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: Do not generate traces for 'com.apple.diagnosticd'.
3197         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: Ditto.
3198         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: Allow 'com.apple.osanalytics.osanalyticshelper' to
3199           be used on internal development builds.
3200         * Shared/WebProcessCreationParameters.cpp:
3201         (WebKit::WebProcessCreationParameters::encode const): Update to handle both 'diagnosticd' and 'osanalyticshelper'
3202         as optional services for internal builds.
3203         (WebKit::WebProcessCreationParameters::decode): Ditto.
3204         * Shared/WebProcessCreationParameters.h:
3205         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3206         (WebKit::diagnosticServices): Ditto.
3207         (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
3208         * WebProcess/cocoa/WebProcessCocoa.mm:
3209         (WebKit::WebProcess::platformInitializeWebProcess): Ditto.
3210
3211 2020-06-04  Per Arne Vollan  <pvollan@apple.com>
3212
3213         [Cocoa] Adopt read-only mode for preferences in the WebContent process
3214         https://bugs.webkit.org/show_bug.cgi?id=212411
3215         <rdar://problem/63640788>
3216
3217         Reviewed by Darin Adler.
3218
3219         The WebContent process should never write preferences. Adopt read-only mode for preferences.
3220         This will fix some sandbox violations when the UI process is notifying the WebContent process
3221         about preference changes. When notified, the WebContent process will use the preferences API
3222         to write those preferences in-process, but there should be no attempt at writing these new
3223         values to disk, which this patch will ensure.
3224
3225         No new tests, since this is fixing a benign sandbox violation.
3226
3227         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
3228         (WebKit::XPCServiceMain):
3229
3230 2020-06-04  Per Arne Vollan  <pvollan@apple.com>
3231
3232         [iOS] The WebContent process should be allowed to consume an extension to the runningboard service
3233         https://bugs.webkit.org/show_bug.cgi?id=212753
3234         <rdar://problem/63948859>
3235
3236         Reviewed by Chris Dumez.
3237
3238         The WebContent process on iOS is failing to consume an extension to the runningboard service, because it is not allowed to do so.
3239
3240         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3241
3242 2020-06-04  Tim Horton  <timothy_horton@apple.com>
3243
3244         Work around broken system version macro
3245         https://bugs.webkit.org/show_bug.cgi?id=212726
3246
3247         Reviewed by Dan Bernstein.
3248
3249         * Configurations/DebugRelease.xcconfig:
3250
3251 2020-06-04  Andy Estes  <aestes@apple.com>
3252
3253         [watchOS] Re-enable content filtering in the simulator build
3254         https://bugs.webkit.org/show_bug.cgi?id=212711
3255         <rdar://problem/63938350>
3256
3257         Reviewed by Wenson Hsieh.
3258
3259         * Configurations/FeatureDefines.xcconfig:
3260
3261 2020-06-04  Kate Cheney  <katherine_cheney@apple.com>
3262
3263         ITP SQLite Database should only vacuum once per day
3264         https://bugs.webkit.org/show_bug.cgi?id=212712
3265         <rdar://problem/63939711>
3266
3267         Reviewed by Brent Fulgham.
3268
3269         Currently the SQLite Database runs a vacuum command each time statistics
3270         are processed. This is probably too frequent, because the database
3271         rarely needs to delete large amounts of data. We can cut this down to once a day.
3272
3273         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
3274         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
3275         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
3276         (WebKit::WebResourceLoadStatisticsStore::performDailyTasks):
3277
3278 2020-06-04  Youenn Fablet  <youenn@apple.com>
3279
3280         Minor optimisation to RemoteAudioBusData::decode
3281         https://bugs.webkit.org/show_bug.cgi?id=212692
3282
3283         Reviewed by Eric Carlson.
3284
3285         * WebProcess/GPU/media/RemoteAudioBusData.h:
3286         (WebKit::RemoteAudioBusData::decode):
3287         Use releaseNonNull to remove some count churn.
3288
3289 2020-06-03  Wenson Hsieh  <wenson_hsieh@apple.com>
3290
3291         [watchOS] fast/events/watchos/change-focus-during-change-event.html crashes
3292         https://bugs.webkit.org/show_bug.cgi?id=212722
3293         <rdar://problem/60633339>
3294
3295         Reviewed by Andy Estes.
3296
3297         When HAVE(QUICKBOARD_COLLECTION_VIEWS) is enabled, the codepath that's used to simulate interacting with the
3298         select menu view controller on watchOS will crash, since it tries to pretend that the user has selected an item
3299         in a table view section (`PUICQuickboardListSectionTextOptions`) that only exists when Quickboard collection
3300         views are disabled. Fix the crash by adjusting the testing codepath to select the item in the first section when
3301         HAVE(QUICKBOARD_COLLECTION_VIEWS) is defined.
3302
3303         * UIProcess/ios/forms/WKSelectMenuListViewController.mm:
3304         (-[WKSelectMenuListViewController selectItemAtIndex:]):
3305
3306 2020-06-03  Jer Noble  <jer.noble@apple.com>
3307
3308         [iOS] Hide the PiP button in fullscreen mode if PiP is disabled in preferences
3309         https://bugs.webkit.org/show_bug.cgi?id=212699
3310         <rdar://problem/60391437>
3311
3312         Reviewed by Eric Carlson.
3313
3314         In r260474, we hid the PiP button in fullscreen when PiP was unsupported on the
3315         current device; we must also hide the PiP button when clients have disabled PiP
3316         via preferences.
3317
3318         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
3319         (-[WKFullScreenViewController videoControlsManagerDidChange]):
3320
3321 2020-06-03  Kate Cheney  <katherine_cheney@apple.com>
3322
3323         Any active sqlite transactions for the ITP database should be aborted when the network process suspends.
3324         https://bugs.webkit.org/show_bug.cgi?id=212608
3325         <rdar://problem/60540768>
3326
3327         Reviewed by Chris Dumez.
3328
3329         Calls to WebResourceLoadStatisticsStore::suspend() should abort any
3330         active SQLite transactions. Unfinished transactions will hold the lock
3331         of a database file and could cause the network process to crash when
3332         suspending.
3333
3334         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
3335         (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
3336         (WebKit::ResourceLoadStatisticsDatabaseStore::~ResourceLoadStatisticsDatabaseStore):
3337         Store all ResourceLoadStatisticsDatabaseStore instances in a static
3338         HashSet so existing transactions can be aborted when the process is
3339         preparing to suspend.
3340
3341         (WebKit::ResourceLoadStatisticsDatabaseStore::interrupt):
3342         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
3343         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
3344         (WebKit::WebResourceLoadStatisticsStore::suspend):
3345
3346 2020-06-03  Chris Dumez  <cdumez@apple.com>
3347
3348         WebProcessPool::notifyPreferencesChanged() is unsafely called on a background thread
3349         https://bugs.webkit.org/show_bug.cgi?id=212697
3350         <rdar://problem/63876652>
3351
3352         Reviewed by Per Arne Vollan.
3353
3354         Make sure we dispatch to the main thread in [WKPreferenceObserver preferenceDidChange] before
3355         we iterate over the process pools and call WebProcessPool::notifyPreferencesChanged() on each
3356         one.
3357
3358         * UIProcess/Cocoa/PreferenceObserver.mm:
3359         (-[WKPreferenceObserver preferenceDidChange:key:encodedValue:]):
3360
3361 2020-06-03  Brent Fulgham  <bfulgham@apple.com>
3362
3363         [iOS] Reduce sandbox logging by permitting necessary sysctl
3364         https://bugs.webkit.org/show_bug.cgi?id=212710
3365         <rdar://problem/63900239>
3366
3367         Reviewed by Per Arne Vollan.
3368
3369         Telemetry indicates that we need to access "sysctl.name2oid" in the
3370         Network process during error handling for HTTP connections. Allow this
3371         access and avoid generating unnecessary logging for this case.
3372
3373         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
3374
3375 2020-06-03  Youenn Fablet  <youenn@apple.com>
3376
3377         Add more logging related to service worker fetch event handling
3378         https://bugs.webkit.org/show_bug.cgi?id=212632
3379         <rdar://problem/63913271>
3380
3381         Unreviewed.
3382         Build fix.
3383
3384         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
3385         (WebKit::WebServiceWorkerFetchTaskClient::continueDidReceiveResponse):
3386
3387 2020-06-03  Alex Christensen  <achristensen@webkit.org>
3388
3389         Pass WebPageProxyIdentifier to PreconnectTask
3390         https://bugs.webkit.org/show_bug.cgi?id=212648
3391
3392         Reviewed by Chris Dumez.
3393
3394         Otherwise, AuthenticationManager::didReceiveAuthenticationChallenge sometimes returned early because there was no pageID.
3395         Observed connecting to real websites from my home wifi.  Unable to test using local servers because connecting happens too fast.
3396
3397         * NetworkProcess/NetworkProcess.cpp:
3398         (WebKit::NetworkProcess::preconnectTo):
3399         * NetworkProcess/NetworkProcess.h:
3400         * NetworkProcess/NetworkProcess.messages.in:
3401         * UIProcess/Network/NetworkProcessProxy.cpp:
3402         (WebKit::NetworkProcessProxy::preconnectTo):
3403         * UIProcess/Network/NetworkProcessProxy.h:
3404         * UIProcess/WebPageProxy.cpp:
3405         (WebKit::WebPageProxy::preconnectTo):
3406
3407 2020-06-03  Rob Buis  <rbuis@igalia.com>
3408
3409         Make generated C++ code use modern C++
3410         https://bugs.webkit.org/show_bug.cgi?id=190714
3411
3412         Reviewed by Jonathan Bedard.
3413
3414         Replace typedef usage by alias-declaration.
3415
3416         * Scripts/test-legacyMessages.h:
3417         * Scripts/test-superclassMessages.h:
3418         * Scripts/testMessages.h:
3419         * Scripts/webkit/messages.py:
3420
3421 2020-06-03  Carlos Garcia Campos  <cgarcia@igalia.com>
3422
3423         [GTK4] WTR: Forward key events to the active popup menu
3424         https://bugs.webkit.org/show_bug.cgi?id=212690
3425
3426         Reviewed by Adrian Perez de Castro.
3427
3428         I forgot to remove the ifdefs when added support for popup menus in r262414.
3429
3430         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3431         (webkitWebViewBaseSynthesizeKeyEvent):
3432
3433 2020-06-03  Carlos Garcia Campos  <cgarcia@igalia.com>
3434
3435         [GTK4] Fix input methods
3436         https://bugs.webkit.org/show_bug.cgi?id=212317
3437
3438         Reviewed by Adrian Perez de Castro.
3439
3440         Stop using GdkEvent to synthesize compositing events, add a specific NativeWebKeyboardEvent constructor for them.
3441
3442         * Shared/NativeWebKeyboardEvent.h:
3443         * Shared/gtk/NativeWebKeyboardEventGtk.cpp:
3444         (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent):
3445         * UIProcess/API/gtk/WebKitInputMethodContextImplGtk.cpp:
3446         (webkitInputMethodContextImplGtkSetClientWidget):
3447         (webkitInputMethodContextImplGtkSetClientWindow): Deleted.
3448         * UIProcess/API/gtk/WebKitInputMethodContextImplGtk.h:
3449         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3450         (webkitWebViewBaseRealize):
3451         (webkitWebViewBaseUnrealize):
3452         (webkitWebViewBaseKeyPressEvent):
3453         (webkitWebViewBaseKeyReleaseEvent):
3454         (webkitWebViewBaseFocusEnter):
3455         (webkitWebViewBaseFocusLeave):
3456         (webkitWebViewBaseKeyPressed):
3457         (webkitWebViewBaseKeyReleased):
3458         (toplevelWindowIsActiveChanged):
3459         (webkitWebViewBaseSynthesizeCompositionKeyPress):
3460
3461 2020-06-03  Santosh Mahto  <santosh.mahto@collabora.com>
3462
3463         [GTK4] Implement file chooser
3464         https://bugs.webkit.org/show_bug.cgi?id=212322
3465
3466         Reviewed by Carlos Garcia Campos.
3467
3468         Port FileChooser to gtk4, Now FileChooser uses undeprecated api's.
3469         Covered by existing tests.
3470
3471         * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
3472         (fileChooserDialogResponseCallback):
3473         (webkitWebViewRunFileChooser):