video.currentTime is not being updated in iOS 13.4 Beta
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2020-02-11  Eric Carlson  <eric.carlson@apple.com>
2
3         video.currentTime is not being updated in iOS 13.4 Beta
4         https://bugs.webkit.org/show_bug.cgi?id=207489
5         <rdar://problem/59322640>
6
7         Reviewed by Youenn Fablet.
8
9         Allow the Web process and the GPU process to communicate with
10         'com.apple.coremedia.audiodeviceclock.xpc' because it is necessary to use a 
11         CMTimeBase, which is used by MediaPlayerPrivateMediaStreamAVFObjC for currentTime.
12
13         Test: fast/mediastream/media-element-current-time.html
14
15         * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb:
16         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
17
18 2020-02-11  Alex Christensen  <achristensen@webkit.org>
19
20         Deprecate _WKUserContentWorld replaced by WKContentWorld
21         https://bugs.webkit.org/show_bug.cgi?id=207514
22
23         Add the rest of the SPI to convert between the two.
24
25         * UIProcess/API/Cocoa/_WKUserContentWorld.h:
26         * UIProcess/API/Cocoa/_WKUserContentWorld.mm:
27         (-[_WKUserContentWorld contentWorld]):
28
29 2020-02-11  Alex Christensen  <achristensen@webkit.org>
30
31         Deprecate _WKUserContentWorld replaced by WKContentWorld
32         https://bugs.webkit.org/show_bug.cgi?id=207514
33
34         Reviewed by Brady Eidson.
35
36         I also add SPI to convert between the two to aid a smooth transition.
37
38         * Shared/Cocoa/APIObject.mm:
39         (API::Object::newObject):
40         * UIProcess/API/APIContentWorld.cpp:
41         (API::ContentWorld::fromUserContentWorld):
42         (API::ContentWorld::ContentWorld):
43         * UIProcess/API/APIContentWorld.h:
44         (API::ContentWorldBase::ContentWorldBase):
45         * UIProcess/API/APIUserContentWorld.cpp:
46         (API::UserContentWorld::fromContentWorld):
47         (API::UserContentWorld::UserContentWorld):
48         * UIProcess/API/APIUserContentWorld.h:
49         * UIProcess/API/Cocoa/WKContentWorld.mm:
50         (-[WKContentWorld _userContentWorld]):
51         * UIProcess/API/Cocoa/WKContentWorldInternal.h:
52         * UIProcess/API/Cocoa/WKContentWorldPrivate.h: Added.
53         * UIProcess/API/Cocoa/WKUserContentController.mm:
54         * UIProcess/API/Cocoa/WKUserScript.mm:
55         * UIProcess/API/Cocoa/_WKUserContentWorld.h:
56         * UIProcess/API/Cocoa/_WKUserContentWorld.mm:
57         * UIProcess/API/Cocoa/_WKUserContentWorldInternal.h:
58         * UIProcess/API/Cocoa/_WKUserStyleSheet.h:
59         * UIProcess/API/Cocoa/_WKUserStyleSheet.mm:
60         * WebKit.xcodeproj/project.pbxproj:
61
62 2020-02-11  Youenn Fablet  <youenn@apple.com>
63
64         REGRESSION (r256009): [ Mojave wk2 Debug ] ASSERTION FAILED: Completion handler should always be called under WebKit::WebMDNSRegister::PendingRegistration
65         https://bugs.webkit.org/show_bug.cgi?id=207521
66         <rdar://problem/59331313>
67
68         Reviewed by Eric Carlson.
69
70         Covered by debug assertion not hit in layout tests.
71
72         * WebProcess/Network/webrtc/WebMDNSRegister.cpp:
73         (WebKit::WebMDNSRegister::finishedRegisteringMDNSName):
74         Call completion handler even if the document entry has been cleared, which can happen in suspend/destruction case.
75         If the entry is not there, all MDNS names for the document have been unregistered. We then report a registration error.
76
77 2020-02-11  Alex Christensen  <achristensen@webkit.org>
78
79         Add WKHTTPCookieStore._getCookiesForURL SPI
80         https://bugs.webkit.org/show_bug.cgi?id=207527
81
82         Reviewed by Brady Eidson.
83
84         This is needed to implement rdar://problem/57193106 without re-implementing the cookie/URL matching logic that exists in CFNetwork.
85         Covered by an API test with a great pun in it.
86
87         * UIProcess/API/APIHTTPCookieStore.cpp:
88         (API::HTTPCookieStore::cookiesForURL):
89         * UIProcess/API/APIHTTPCookieStore.h:
90         * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
91         (-[WKHTTPCookieStore _getCookiesForURL:completionHandler:]):
92         * UIProcess/API/Cocoa/WKHTTPCookieStorePrivate.h: Added.
93         * WebKit.xcodeproj/project.pbxproj:
94
95 2020-02-11  Youenn Fablet  <youenn@apple.com>
96
97         WebSWServerConnection::registerServiceWorkerClient is not sending IPC message to UIProcess when it should
98         https://bugs.webkit.org/show_bug.cgi?id=207537
99
100         Reviewed by Chris Dumez.
101
102         Covered by added API test.
103
104         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
105         (WebKit::WebSWServerConnection::registerServiceWorkerClient):
106         Fix use after move so that we can get the context connection and send the IPC message to UIProcess as expected.
107
108 2020-02-11  Brady Eidson  <beidson@apple.com>
109
110         Add WKContentWorld.h to WebKit.h
111         https://bugs.webkit.org/show_bug.cgi?id=207351
112
113         Suggested by Alex Christensen.
114
115         * Shared/API/Cocoa/WebKit.h:
116
117 2020-02-11  Youenn Fablet  <youenn@apple.com>
118
119         Use ObjectIdentifier for WebSocketStream/WebSocketChannel
120         https://bugs.webkit.org/show_bug.cgi?id=207507
121
122         Reviewed by Alex Christensen.
123
124         Replace uint64_t by ObjectIdentifier.
125         This adds type safety and ensures we get valid identifiers from IPC.
126         We still need to check for destinationID being not null in a few places.
127         No observable change of behavior.
128
129         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
130         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
131         (WebKit::NetworkConnectionToWebProcess::createSocketStream):
132         (WebKit::NetworkConnectionToWebProcess::createSocketChannel):
133         (WebKit::NetworkConnectionToWebProcess::removeSocketChannel):
134         * NetworkProcess/NetworkConnectionToWebProcess.h:
135         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
136         * NetworkProcess/NetworkSocketChannel.cpp:
137         (WebKit::NetworkSocketChannel::create):
138         (WebKit::NetworkSocketChannel::NetworkSocketChannel):
139         * NetworkProcess/NetworkSocketChannel.h:
140         * NetworkProcess/NetworkSocketStream.cpp:
141         (WebKit::NetworkSocketStream::create):
142         (WebKit::NetworkSocketStream::NetworkSocketStream):
143         (WebKit::NetworkSocketStream::messageSenderDestinationID const):
144         * NetworkProcess/NetworkSocketStream.h:
145         * Scripts/webkit/messages.py:
146         * WebKit.xcodeproj/project.pbxproj:
147         * WebProcess/Network/NetworkProcessConnection.cpp:
148         (WebKit::NetworkProcessConnection::didReceiveMessage):
149         * WebProcess/Network/WebSocketChannel.cpp:
150         (WebKit::WebSocketChannel::WebSocketChannel):
151         (WebKit::WebSocketChannel::messageSenderDestinationID const):
152         (WebKit::WebSocketChannel::connect):
153         * WebProcess/Network/WebSocketChannel.h:
154         (WebKit::WebSocketChannel::identifier const):
155         * WebProcess/Network/WebSocketChannelManager.cpp:
156         (WebKit::WebSocketChannelManager::didReceiveMessage):
157         * WebProcess/Network/WebSocketChannelManager.h:
158         * WebProcess/Network/WebSocketIdentifier.h: Added.
159         * WebProcess/Network/WebSocketStream.cpp:
160         (WebKit::WebSocketStream::streamWithIdentifier):
161         (WebKit::WebSocketStream::WebSocketStream):
162         (WebKit::WebSocketStream::~WebSocketStream):
163         (WebKit::WebSocketStream::messageSenderDestinationID const):
164         * WebProcess/Network/WebSocketStream.h:
165
166 2020-02-11  chris fleizach  <cfleizach@apple.com>
167
168         AX: Unable to build webkit open source - build errors related to AXClientType
169         https://bugs.webkit.org/show_bug.cgi?id=207524
170         <rdar://problem/59279722>
171
172         Reviewed by Mark Lam.
173
174         * Platform/spi/mac/ApplicationServicesSPI.h:
175
176 2020-02-10  Jiewen Tan  <jiewen_tan@apple.com>
177
178         [WebAuthn] Move the async code from WebAuthenticationPanelClient to AuthenticatorManager
179         https://bugs.webkit.org/show_bug.cgi?id=206248
180
181         Reviewed by Alex Christensen.
182
183         No change of behaviors.
184
185         * UIProcess/API/APIWebAuthenticationPanelClient.h:
186         (API::WebAuthenticationPanelClient::selectAssertionResponse const):
187         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
188         (WebKit::AuthenticatorManager::serviceStatusUpdated):
189         (WebKit::AuthenticatorManager::authenticatorStatusUpdated):
190         (WebKit::AuthenticatorManager::requestPin):
191         (WebKit::AuthenticatorManager::selectAssertionResponse):
192         (WebKit::AuthenticatorManager::runPanel):
193         (WebKit::AuthenticatorManager::invokePendingCompletionHandler):
194         (WebKit::AuthenticatorManager::dispatchPanelClientCall const):
195         * UIProcess/WebAuthentication/AuthenticatorManager.h:
196         * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h:
197         * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.mm:
198         (WebKit::WebAuthenticationPanelClient::updatePanel const):
199         (WebKit::WebAuthenticationPanelClient::dismissPanel const):
200         (WebKit::WebAuthenticationPanelClient::requestPin const):
201         (WebKit::WebAuthenticationPanelClient::selectAssertionResponse const):
202
203 2020-02-10  Alan Sien Wei Hshieh  <hshieh@apple.com>
204
205         Add a variant of -[WKWebViewPrivate _getContentsAsStringWithCompletionHandler:] that includes contents from subframes
206         https://bugs.webkit.org/show_bug.cgi?id=207352
207         <rdar://problem/59115798>
208
209         Reviewed by Alex Christensen.
210
211         A number of intelligence features like Spotlight rely on -_getContentsAsStringWithCompletionHandler:. However, this
212         method does not return content strings for subframes. This means that Spotlight and others are not able to get
213         text for things like AMP pages, that live in subframes. -_getContentsAsStringWithCompletionHandler: has clients outside
214         of just intelligence features, and we don't want to wholesale change their behavior. As a result, introduce a new
215         -_getContentsAsStringInAllFrames:withCompletionHandler: which clients can adopt as necessary. Providing NO for the first
216         parameter allows clients to get the same contents as -_getContentsAsStringWithCompletionHandler:. Otherwise, we enumerate
217         all subframes and extract text from there. Finally, append a test for getting stuff out of frames.
218
219         * UIProcess/API/Cocoa/WKWebView.mm:
220         (-[WKWebView _getContentsAsStringWithCompletionHandler:]): 
221         (-[WKWebView _getContentsOfAllFramesAsStringWithCompletionHandler:]): Call the new function to extract contents from all
222         frames.
223
224         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Expose a new SPI for clients.
225
226         * UIProcess/WebPageProxy.cpp:
227         (WebKit::WebPageProxy::getContentsAsStringInAllFrames): Piping. This emulates what getContentsAsString() does.
228
229         * UIProcess/WebPageProxy.h: Expose new method.
230
231         * WebProcess/WebPage/WebPage.cpp:
232         (WebKit::WebPage::getContentsAsString): Augment to take a flag saying whether or not we want to extract
233         from all frames. If we do, iterate over all the frames and get their content strings, appending two
234         new lines in the middle.
235  
236         * WebProcess/WebPage/WebPage.h:
237         * WebProcess/WebPage/WebPage.messages.in: Piping.
238
239         * Shared/ContentAsStringIncludesChildFrames.h: Add a new header to expose an enum.
240
241 2020-02-10  Per Arne Vollan  <pvollan@apple.com>
242
243         [iOS] Crash when granting access to asset services
244         https://bugs.webkit.org/show_bug.cgi?id=207520
245         <rdar://problem/59321848>
246
247         Reviewed by Brent Fulgham.
248
249         Pass correct handle when calling SandboxExtension::createHandleForMachLookup.
250
251         API test: WebKit.GrantAccessToMobileAssetsCrash
252
253         * UIProcess/ios/WebPageProxyIOS.mm:
254         (WebKit::WebPageProxy::grantAccessToAssetServices):
255
256 2020-02-10  David Kilzer  <ddkilzer@apple.com>
257
258         WebKit::WebProcessPool::initializeClassesForParameterCoding() should keep a copy of CString
259         <https://webkit.org/b/207519>
260         <rdar://problem/59043436>
261
262         Reviewed by Brent Fulgham.
263
264         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
265         (WebKit::WebProcessPool::initializeClassesForParameterCoding):
266         - Change `className` to keep a copy of the CString object.
267
268 2020-02-10  Per Arne Vollan  <pvollan@apple.com>
269
270         [watchOS] Notification listener is never unregistered
271         https://bugs.webkit.org/show_bug.cgi?id=207459
272         <rdar://problem/58923393>
273
274         Reviewed by Maciej Stachowiak.
275
276         On watchOS, the backlight changed notification is registered in WebProcessPool::registerNotificationObservers(),
277         but not unregistered in WebProcessPool::unregisterNotificationObservers().
278
279         API test: WebKit.BacklightLevelNotificationCrash
280
281         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
282         (WebKit::WebProcessPool::unregisterNotificationObservers):
283
284 2020-02-10  James Howard  <jameshoward@mac.com>
285
286         Standard gamepad mapping for GameControllerGamepads
287         https://bugs.webkit.org/show_bug.cgi?id=206033
288
289         Reviewed by Dean Jackson.
290         
291         Make the mapping as provided by PlatformGamepad
292         available in UIGamepad, and pass it along to
293         GamepadData so it can be correctly reflected
294         in the Gamepad API.
295
296         * Shared/Gamepad/GamepadData.cpp:
297         (WebKit::GamepadData::GamepadData):
298         (WebKit::GamepadData::encode const):
299         (WebKit::GamepadData::decode):
300         * Shared/Gamepad/GamepadData.h:
301         (WebKit::GamepadData::mapping const):
302         * UIProcess/Gamepad/UIGamepad.cpp:
303         (WebKit::UIGamepad::UIGamepad):
304         (WebKit::UIGamepad::fullGamepadData const):
305         * UIProcess/Gamepad/UIGamepad.h:
306         * WebProcess/Gamepad/WebGamepad.cpp:
307         (WebKit::WebGamepad::WebGamepad):
308
309 2020-02-10  Daniel Bates  <dabates@apple.com>
310
311         Disallow setting base URL to a data or JavaScript URL
312         https://bugs.webkit.org/show_bug.cgi?id=207136
313
314         Reviewed by Brent Fulgham.
315
316         Apply base URL restrictions to apps linked to a future WebKit to avoid breaking existing apps.
317
318         * Shared/WebPreferences.yaml:
319         * UIProcess/API/Cocoa/WKWebView.mm:
320         (shouldRestrictBaseURLSchemes): Added.
321         (-[WKWebView _setupPageConfiguration:]): Update settings.
322         * UIProcess/Cocoa/VersionChecks.h:
323
324 2020-02-10  Chris Dumez  <cdumez@apple.com>
325
326         Crash under WebProcessProxy::shouldSendPendingMessage()
327         https://bugs.webkit.org/show_bug.cgi?id=207464
328         <rdar://problem/59293825>
329
330         Reviewed by Alex Christensen.
331
332         I suspect the WebProcessProxy object is getting destroyed as we are iterating over the
333         pending messages in AuxiliaryProcessProxy::didFinishLaunching(), thus crashing when
334         calling WebProcessProxy::shouldSendPendingMessage() inside the loop. As a speculative
335         fix, protect |this| at the beginning of WebProcessProxy::didFinishLaunching().
336
337         * UIProcess/WebProcessProxy.cpp:
338         (WebKit::WebProcessProxy::didFinishLaunching):
339
340 2020-02-10  youenn fablet  <youenn@apple.com>
341
342         Use ObjectIdentifier for WebRTC resolvers
343         https://bugs.webkit.org/show_bug.cgi?id=207381
344
345         Reviewed by Eric Carlson.
346
347         Use ObjectIdentifier instead of uint64_t which gives type safety and ensures we do not receive wrong identifiers from IPC.
348         No change of behavior.
349
350         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
351         (WebKit::NetworkRTCProvider::close):
352         (WebKit::NetworkRTCProvider::createResolver):
353         Remove empty string check case since DNS resolver should be robust to null/empty strings.
354         (WebKit::NetworkRTCProvider::stopResolver):
355         * NetworkProcess/webrtc/NetworkRTCProvider.h:
356         * NetworkProcess/webrtc/NetworkRTCProvider.messages.in:
357         * NetworkProcess/webrtc/NetworkRTCResolver.cpp:
358         (WebKit::NetworkRTCResolver::create):
359         (WebKit::NetworkRTCResolver::NetworkRTCResolver):
360         (WebKit::NetworkRTCResolver::start):
361         (WebKit::NetworkRTCResolver::stop):
362         * NetworkProcess/webrtc/NetworkRTCResolver.h:
363         * NetworkProcess/webrtc/NetworkRTCResolverCocoa.cpp:
364         (WebKit::NetworkRTCResolver::create):
365         (WebKit::NetworkRTCResolverCocoa::NetworkRTCResolverCocoa):
366         * NetworkProcess/webrtc/NetworkRTCResolverCocoa.h:
367         * Scripts/webkit/messages.py:
368         * WebKit.xcodeproj/project.pbxproj:
369         * WebProcess/Network/NetworkProcessConnection.cpp:
370         (WebKit::NetworkProcessConnection::didReceiveMessage):
371         * WebProcess/Network/webrtc/LibWebRTCNetwork.h:
372         (WebKit::LibWebRTCNetwork::resolver):
373         * WebProcess/Network/webrtc/LibWebRTCResolver.cpp:
374         (WebKit::LibWebRTCResolver::Start):
375         (WebKit::LibWebRTCResolver::Destroy):
376         * WebProcess/Network/webrtc/LibWebRTCResolver.h:
377         * WebProcess/Network/webrtc/LibWebRTCResolverIdentifier.h: Copied from Source/WebKit/WebProcess/Network/webrtc/WebRTCResolver.h.
378         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
379         (WebKit::LibWebRTCSocketFactory::createAsyncResolver):
380         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.h:
381         (WebKit::LibWebRTCSocketFactory::resolver):
382         (WebKit::LibWebRTCSocketFactory::takeResolver):
383         * WebProcess/Network/webrtc/WebRTCResolver.cpp:
384         (WebKit::WebRTCResolver::WebRTCResolver):
385         * WebProcess/Network/webrtc/WebRTCResolver.h:
386
387 2020-02-10  Truitt Savell  <tsavell@apple.com>
388
389         Unreviewed, rolling out r256091.
390
391         Broke internal builds
392
393         Reverted changeset:
394
395         "Move trivial definitions from FeatureDefines.xcconfig to
396         PlatformEnableCocoa.h"
397         https://bugs.webkit.org/show_bug.cgi?id=207155
398         https://trac.webkit.org/changeset/256091
399
400 2020-02-10  Truitt Savell  <tsavell@apple.com>
401
402         Unreviewed, rolling out r256103.
403
404         This patch is blocking the rollout of r256091
405
406         Reverted changeset:
407
408         "Move JavaScriptCore related feature defines from
409         FeatureDefines.xcconfig to PlatformEnableCocoa.h"
410         https://bugs.webkit.org/show_bug.cgi?id=207436
411         https://trac.webkit.org/changeset/256103
412
413 2020-02-10  Adrian Perez de Castro  <aperez@igalia.com>
414
415         [geolocation] Fix non-unified build issues
416         https://bugs.webkit.org/show_bug.cgi?id=207457
417
418         Unreviewed build fix.
419
420         No new tests needed.
421
422         * UIProcess/GeolocationPermissionRequestManagerProxy.h: Add missing includes.
423         * UIProcess/WebGeolocationManagerProxy.cpp: Ditto.
424
425 2020-02-10  Adrian Perez de Castro  <aperez@igalia.com>
426
427         [GTK][WebInspector] Do not make Web Inspector windows transient
428         https://bugs.webkit.org/show_bug.cgi?id=207455
429
430         Reviewed by Carlos Garcia Campos.
431
432         Stop setting Web Inspector windows as transient for the window
433         containing the web view being inspected, to allow changing their
434         relative stacking order. No changes are needed for inspector windows
435         to continue being destroyed correctly when the corresponding web view
436         is destroyed because code for handling that was already present in
437         WebInspectorProxyGtk.cpp.
438
439         No new tests needed.
440
441         * UIProcess/Inspector/gtk/RemoteWebInspectorProxyGtk.cpp:
442         (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
443         Do not pass a parent window parameter to webkitInspectorWindowNew().
444         * UIProcess/Inspector/gtk/WebInspectorProxyGtk.cpp:
445         (WebKit::WebInspectorProxy::platformCreateFrontendWindow): Remove code
446         to obtain the top level window of the WebKitWebView, which no longer
447         needs being passed to webkitInspectorWindowNew().
448         * UIProcess/Inspector/gtk/WebKitInspectorWindow.cpp:
449         (webkitInspectorWindowNew): Do not set the GtkWindow.transient-for
450         property for the Web Inspector window. Remove the parent window
451         parameter.
452         * UIProcess/Inspector/gtk/WebKitInspectorWindow.h: Remove the parent
453         window parameter for webkitInspectorWindowNew().
454
455 2020-02-10  Enrique Ocaña González  <eocanha@igalia.com>
456
457         [GTK] Mouse pointer no longer hidden during fullscreen video playback
458         https://bugs.webkit.org/show_bug.cgi?id=197346
459
460         Reviewed by Adrian Perez de Castro.
461
462         Covered by existing tests.
463
464         * UIProcess/API/gtk/PageClientImpl.cpp:
465         (WebKit::PageClientImpl::setCursorHiddenUntilMouseMoves): Added implementation.
466
467 2020-02-10  Adrian Perez de Castro  <aperez@igalia.com>
468
469         [GTK][WebInspector] Always allow data:// URIs for inspector views
470         https://bugs.webkit.org/show_bug.cgi?id=207454
471
472         Reviewed by Carlos Garcia Campos.
473
474         No new tests needed.
475
476         * UIProcess/Inspector/gtk/WebInspectorProxyGtk.cpp:
477         (WebKit::WebInspectorProxy::platformCreateFrontendPage): The Web
478         Inspector may use navigation to data:// URLs, so always allow it.
479
480 2020-02-09  Lauro Moura  <lmoura@igalia.com>
481
482         [GTK][WPE] Expose allowTopNavigationToDataURL
483         https://bugs.webkit.org/show_bug.cgi?id=207384
484
485         Reviewed by Adrian Perez de Castro.
486
487         This patch exposes the new property "allow-top-navigation-to-data-urls"
488         from r255961 to the glib-based APIs.
489
490         * UIProcess/API/glib/WebKitSettings.cpp:
491         (webKitSettingsSetProperty): Set new property.
492         (webKitSettingsGetProperty): Get new property.
493         (webkit_settings_class_init): Register new property.
494         (webkit_settings_get_allow_top_navigation_to_data_urls): Added.
495         (webkit_settings_set_allow_top_navigation_to_data_urls): Added.
496         * UIProcess/API/gtk/WebKitSettings.h:
497         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
498         * UIProcess/API/wpe/WebKitSettings.h:
499         * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:
500
501 2020-02-09  Keith Rollin  <krollin@apple.com>
502
503         Re-enable LTO for ARM builds
504         https://bugs.webkit.org/show_bug.cgi?id=207402
505         <rdar://problem/49190767>
506
507         Reviewed by Sam Weinig.
508
509         Bug 190758 re-enabled LTO for Production builds for x86-family CPUs.
510         Enabling it for ARM was left out due to a compiler issue. That issue
511         has been fixed, and so now we can re-enable LTO for ARM.
512
513         * Configurations/Base.xcconfig:
514
515 2020-02-09  Wenson Hsieh  <wenson_hsieh@apple.com>
516
517         Fix the watchOS build after <rdar://problem/56134081>
518         https://bugs.webkit.org/show_bug.cgi?id=207443
519         <rdar://problem/59295173>
520
521         Reviewed by Maciej Stachowiak.
522
523         Use the version of the SPI that's guaranteed to be available across all platforms.
524
525         * UIProcess/ios/WKContentViewInteraction.mm:
526         (gestureRecognizerModifierFlags):
527
528 2020-02-09  Kate Cheney  <katherine_cheney@apple.com>
529
530         [ Mac wk2 ] http/tests/resourceLoadStatistics/log-cross-site-load-with-link-decoration.html is a flaky failure
531         https://bugs.webkit.org/show_bug.cgi?id=207271
532         <rdar://problem/59190346>
533
534         Reviewed by Maciej Stachowiak.
535
536         This patch adds a check to make sure a test is expecting a statistics
537         processing call before proceeding. Otherwise, this can cause
538         flakiness in ITP tests if data is removed/changed during the test.
539
540         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
541         (WebKit::ResourceLoadStatisticsStore::processStatisticsAndDataRecords):
542
543 2020-02-08  Sam Weinig  <weinig@apple.com>
544
545         Move JavaScriptCore related feature defines from FeatureDefines.xcconfig to PlatformEnableCocoa.h
546         https://bugs.webkit.org/show_bug.cgi?id=207436
547
548         Reviewed by Tim Horton.
549
550         * Configurations/FeatureDefines.xcconfig:
551         Remove ENABLE_FAST_JIT_PERMISSIONS and ENABLE_FTL_JIT.
552
553 2020-02-08  Wenson Hsieh  <wenson_hsieh@apple.com>
554
555         REGRESSION (r256072): ScrollViewScrollabilityTests.ScrollableWithOverflowHiddenAndInputView fails
556         https://bugs.webkit.org/show_bug.cgi?id=207425
557         Followup to <rdar://problem/56960774>
558
559         Reviewed by Tim Horton.
560
561         The failing test ScrollViewScrollabilityTests.ScrollableWithOverflowHiddenAndInputView relies on -[WKWebView
562         _zoomToFocusRect:...:] to modify the zoom scale of WKScrollView in order for the next layer tree transaction to
563         have a zoom scale not equal to the initial scale, which in turn ensures that we make the UIScrollView scrollable
564         after the next remote layer tree update.
565
566         The change in r256072 caused us to bail early in -_zoomToFocusRect: and -_zoomToPoint: in the case where the
567         scroll view is not scrollable (i.e. the page has `overflow: hidden`); this means that if all the following
568         conditions are met, we now avoid zooming into focused elements, whereas we would've zoomed before the change:
569
570         1.  The user is focusing an element on an iPhone.
571         2.  The document body has `overflow: hidden;`, or the WebKit client has called `-setScrollEnabled:NO`.
572         3.  Either an SPI client has vended an empty input view and input accessory view, or the focused element has
573             inputmode="none".
574
575         To fix the test and restore zooming behavior, we partially revert the change in r256072, such that we no longer
576         bail from WKWebView's zooming codepaths if the scrollEnabled property is NO.
577
578         * UIProcess/API/ios/WKWebViewIOS.mm:
579         (-[WKWebView _zoomToPoint:atScale:animated:]):
580         (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
581
582 2020-02-08  Sam Weinig  <weinig@apple.com>
583
584         Move trivial definitions from FeatureDefines.xcconfig to PlatformEnableCocoa.h
585         https://bugs.webkit.org/show_bug.cgi?id=207155
586
587         Reviewed by Tim Horton.
588
589         Move all trivial definitions (just ENABLE_FOO = ENABLE_FOO; or ENABLE_BAR = ;)
590         from the FeatureDefines.xcconfigs to PlatformEnableCocoa.h, ensuring each one
591         also has a default value in PlatformEnable.h
592
593         To support the move, DerivedSources.make and generate-unified-sources.sh have been 
594         updated to generate the list of ENABLE_* features by directly from preprocessing 
595         Platform.h, rather than just getting the partial list from the xcconfig file.
596
597         * Configurations/FeatureDefines.xcconfig:
598         * DerivedSources.make:
599         * Scripts/generate-unified-sources.sh:
600
601 2020-02-08  John Wilander  <wilander@apple.com>
602
603         Resource Load Statistics: Hold off non-cookie website data deletion until an hour after user interaction
604         https://bugs.webkit.org/show_bug.cgi?id=207418
605         <rdar://problem/58550164>
606
607         Reviewed by Chris Dumez.
608
609         This change makes sure there is at least a one-hour or older timestamp
610         for user interaction for some website before activating deletion of
611         non-cookie website data for sites the user has not interacted with.
612         This ensures that a fresh start such as after a reset or on a new
613         device doesn't interpret the lack of data as lack of user interaction.
614
615         No new tests. Existing tests make sure we don't regress the functionality.
616
617         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
618         (WebKit::ResourceLoadStatisticsDatabaseStore::registrableDomainsToRemoveWebsiteDataFor):
619         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
620         (WebKit::ResourceLoadStatisticsMemoryStore::registrableDomainsToRemoveWebsiteDataFor):
621
622 2020-02-07  Jon Lee  <jonlee@apple.com>
623
624         Web Inspector: Revert slim toolbar
625         https://bugs.webkit.org/show_bug.cgi?id=207422
626
627         Reviewed by Timothy Hatcher.
628
629         The slim toolbar needs a little more work before landing.
630
631         This patch reverts r255547, r255557, r255890, r255892, r255893, r255901, r255980.
632
633         * UIProcess/Inspector/RemoteWebInspectorProxy.cpp:
634         * UIProcess/Inspector/RemoteWebInspectorProxy.h:
635         * UIProcess/Inspector/RemoteWebInspectorProxy.messages.in:
636         * UIProcess/Inspector/WebInspectorProxy.cpp:
637         * UIProcess/Inspector/WebInspectorProxy.h:
638         * UIProcess/Inspector/WebInspectorProxy.messages.in:
639         * UIProcess/Inspector/gtk/RemoteWebInspectorProxyGtk.cpp:
640         * UIProcess/Inspector/gtk/WebInspectorProxyGtk.cpp:
641         * UIProcess/Inspector/mac/RemoteWebInspectorProxyMac.mm:
642         * UIProcess/Inspector/mac/WebInspectorProxyMac.mm:
643         * UIProcess/Inspector/win/RemoteWebInspectorProxyWin.cpp:
644         * UIProcess/Inspector/win/WebInspectorProxyWin.cpp:
645         * WebProcess/Inspector/RemoteWebInspectorUI.cpp:
646         * WebProcess/Inspector/RemoteWebInspectorUI.h:
647         * WebProcess/Inspector/WebInspectorUI.cpp:
648         * WebProcess/Inspector/WebInspectorUI.h:
649
650 2020-02-07  Kate Cheney  <katherine_cheney@apple.com>
651
652         REGRESSION: ASSERTION FAILED: resetResult == 0 on regression tests in ITP code, resetting SQLite statement
653         https://bugs.webkit.org/show_bug.cgi?id=207269
654         <rdar://problem/59188891>
655
656         Reviewed by Brady Eidson.
657
658         Adds logging if ITP telemetry calculations fail to step and makes sure
659         not to reset the statement in this case as it will result in an error.
660
661         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
662
663 2020-02-07  Chris Dumez  <cdumez@apple.com>
664
665         [IPC Hardening] Protect against bad parameters in WebProcessProxy::getPluginProcessConnection()
666         https://bugs.webkit.org/show_bug.cgi?id=207416
667         <rdar://problem/58617244>
668
669         Reviewed by David Kilzer.
670
671         * UIProcess/Plugins/PluginProcessManager.cpp:
672         (WebKit::PluginProcessManager::getPluginProcessConnection):
673         * UIProcess/Plugins/PluginProcessManager.h:
674         * UIProcess/WebProcessProxy.cpp:
675         (WebKit::WebProcessProxy::getPluginProcessConnection):
676
677 2020-02-07  Chris Dumez  <cdumez@apple.com>
678
679         [IPC Hardening] Convert some debug assertions into MESSAGE_CHECKs in WebPaymentCoordinatorProxy
680         https://bugs.webkit.org/show_bug.cgi?id=207414
681         <rdar://problem/58507177>
682
683         Reviewed by Andy Estes.
684
685         * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
686         (WebKit::WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard):
687         (WebKit::WebPaymentCoordinatorProxy::openPaymentSetup):
688         (WebKit::WebPaymentCoordinatorProxy::showPaymentUI):
689         (WebKit::WebPaymentCoordinatorProxy::completeMerchantValidation):
690         (WebKit::WebPaymentCoordinatorProxy::completeShippingMethodSelection):
691         (WebKit::WebPaymentCoordinatorProxy::completeShippingContactSelection):
692         (WebKit::WebPaymentCoordinatorProxy::completePaymentMethodSelection):
693
694 2020-02-07  Alex Christensen  <achristensen@webkit.org>
695
696         Harden HashTable IPC decoders
697         https://bugs.webkit.org/show_bug.cgi?id=207415
698
699         Reviewed by Chris Dumez.
700
701         * Platform/IPC/ArgumentCoders.h:
702
703 2020-02-07  Chris Dumez  <cdumez@apple.com>
704
705         [Hardening] Validate Geolocation access permission on UIProcess side
706         https://bugs.webkit.org/show_bug.cgi?id=207393
707         <rdar://problem/56816051>
708
709         Reviewed by Brent Fulgham.
710
711         * UIProcess/GeolocationPermissionRequestManagerProxy.cpp:
712         (WebKit::GeolocationPermissionRequestManagerProxy::didReceiveGeolocationPermissionDecision):
713         (WebKit::GeolocationPermissionRequestManagerProxy::isValidAuthorizationToken const):
714         (WebKit::GeolocationPermissionRequestManagerProxy::revokeAuthorizationToken):
715         * UIProcess/GeolocationPermissionRequestManagerProxy.h:
716         * UIProcess/WebGeolocationManagerProxy.cpp:
717         (WebKit::WebGeolocationManagerProxy::startUpdating):
718         * UIProcess/WebGeolocationManagerProxy.h:
719         * UIProcess/WebGeolocationManagerProxy.messages.in:
720         * UIProcess/WebPageProxy.cpp:
721         * UIProcess/WebPageProxy.h:
722         (WebKit::WebPageProxy::geolocationPermissionRequestManager):
723         * UIProcess/WebPageProxy.messages.in:
724         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
725         (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
726         (WebKit::GeolocationPermissionRequestManager::revokeAuthorizationToken):
727         (WebKit::GeolocationPermissionRequestManager::didReceiveGeolocationPermissionDecision):
728         * WebProcess/Geolocation/GeolocationPermissionRequestManager.h:
729         * WebProcess/Geolocation/WebGeolocationManager.cpp:
730         (WebKit::WebGeolocationManager::registerWebPage):
731         * WebProcess/Geolocation/WebGeolocationManager.h:
732         * WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
733         (WebKit::WebGeolocationClient::startUpdating):
734         (WebKit::WebGeolocationClient::revokeAuthorizationToken):
735         * WebProcess/WebCoreSupport/WebGeolocationClient.h:
736         * WebProcess/WebPage/WebPage.cpp:
737         (WebKit::WebPage::didReceiveGeolocationPermissionDecision):
738         * WebProcess/WebPage/WebPage.h:
739         * WebProcess/WebPage/WebPage.messages.in:
740
741 2020-02-07  Alex Christensen  <achristensen@apple.com>
742
743         Remember if we used legacy TLS in the back/forward cache like we remember if we have only secure content
744         https://bugs.webkit.org/show_bug.cgi?id=207409
745         rdar://problem/59275641
746
747         Reviewed by Chris Dumez.
748
749         * Scripts/webkit/messages.py:
750         * UIProcess/WebPageProxy.cpp:
751         (WebKit::WebPageProxy::hasInsecureContent):
752         * UIProcess/WebPageProxy.h:
753         * UIProcess/WebPageProxy.messages.in:
754         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
755         (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
756         (WebKit::WebFrameLoaderClient::savePlatformDataToCachedFrame):
757         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
758
759 2020-02-07  Wenson Hsieh  <wenson_hsieh@apple.com>
760
761         [iOS] Double tapping shouldn't scroll the page when the body has `overflow: hidden`
762         https://bugs.webkit.org/show_bug.cgi?id=207390
763         <rdar://problem/56960774>
764
765         Reviewed by Tim Horton and Simon Fraser.
766
767         Bail out of several codepaths that zoom and scroll WKScrollView as a result of smart magnification gestures
768         (e.g. one-finger double taps), in the case where scrolling has been disabled on WKScrollView. This may occur
769         if the page has `overflow: hidden` on the body or root, but may also happen due to a WebKit client disabling
770         scrolling via native API, such as `webView.scrollView.scrollingEnabled = NO;`.
771
772         Test: fast/scrolling/ios/double-tap-to-scroll-with-scrolling-disabled.html
773
774         * UIProcess/API/ios/WKWebViewIOS.mm:
775         (-[WKWebView _zoomToPoint:atScale:animated:]):
776         (-[WKWebView _scrollToRect:origin:minimumScrollDistance:]):
777
778         Drive-by fix: change some `false`s to `NO`s, and `true`s to `YES`s.
779
780         (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
781
782 2020-02-07  Timothy Hatcher  <timothy@apple.com>
783
784         Crash under WKBundleFrameForJavaScriptContext dereferencing a NULL WebCore::Frame.
785         https://bugs.webkit.org/show_bug.cgi?id=207407
786         rdar://problem/59206599
787
788         Reviewed by Tim Horton.
789
790         * WebProcess/WebPage/WebFrame.cpp:
791         (WebKit::WebFrame::frameForContext): Add a null check for the coreFrame.
792
793 2020-02-07  Ryan Haddad  <ryanhaddad@apple.com>
794
795         Unreviewed, rolling out r256051.
796
797         Broke internal builds.
798
799         Reverted changeset:
800
801         "Move trivial definitions from FeatureDefines.xcconfig to
802         PlatformEnableCocoa.h"
803         https://bugs.webkit.org/show_bug.cgi?id=207155
804         https://trac.webkit.org/changeset/256051
805
806 2020-02-07  Jiewen Tan  <jiewen_tan@apple.com>
807
808         [WebAuthn] Report CTAP Client Pin Error to clients
809         https://bugs.webkit.org/show_bug.cgi?id=205837
810         <rdar://problem/58356872>
811
812         Reviewed by Brent Fulgham.
813
814         Authenticators could return four different errors { kCtap2ErrPinInvalid, kCtap2ErrPinBlocked, kCtap2ErrPinAuthInvalid, kCtap2ErrPinAuthBlocked }
815         during 1) GetPinToken or 2) MakeCredential/GetAssertion with PinAuth.
816
817         All errors should be reported to the client so that appropriate UI can be displayed to users.
818         For kCtap2ErrPinAuthInvalid and kCtap2ErrPinInvalid, we will restart the whole Pin process to get
819         another Pin from the user.
820
821         Covered by API tests.
822
823         * UIProcess/API/APIWebAuthenticationPanelClient.h:
824         * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.mm:
825         (WebKit::wkWebAuthenticationPanelUpdate):
826         * UIProcess/WebAuthentication/WebAuthenticationFlags.h:
827         * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:
828         (WebKit::fido::toStatus):
829         (WebKit::fido::isPinError):
830         (WebKit::CtapAuthenticator::continueMakeCredentialAfterResponseReceived):
831         (WebKit::CtapAuthenticator::continueGetAssertionAfterResponseReceived):
832         (WebKit::CtapAuthenticator::continueRequestAfterGetPinToken):
833         (WebKit::CtapAuthenticator::tryRestartPin):
834         * UIProcess/WebAuthentication/fido/CtapAuthenticator.h:
835
836 2020-02-07  Jonathan Bedard  <jbedard@apple.com>
837
838         Handle deprecated APIs in WKImagePreviewViewController
839         https://bugs.webkit.org/show_bug.cgi?id=207398
840
841         Reviewed by Tim Horton.
842
843         No new tests, build fix.
844
845         * UIProcess/WKImagePreviewViewController.mm:
846         (-[WKImagePreviewViewController previewActionItems]): Add deprecation macros.
847
848 2020-02-07  Kate Cheney  <katherine_cheney@apple.com>
849
850        Regression (r256011): http/tests/resourceLoadStatistics/aggregate-sorted-data-no-storage-access.html is consistently failing
851        https://bugs.webkit.org/show_bug.cgi?id=207382
852        <rdar://problem/59259844>
853
854        Sort the resource load statistics dumping results so they consistently
855        print in the same order.
856
857         Reviewed by Yusuke Suzuki.
858
859         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
860         (WebKit::ResourceLoadStatisticsMemoryStore::dumpResourceLoadStatistics):
861
862 2020-02-07  Sam Weinig  <weinig@apple.com>
863
864         Move trivial definitions from FeatureDefines.xcconfig to PlatformEnableCocoa.h
865         https://bugs.webkit.org/show_bug.cgi?id=207155
866
867         Reviewed by Tim Horton.
868
869         Move all trivial definitions (just ENABLE_FOO = ENABLE_FOO; or ENABLE_BAR = ;)
870         from the FeatureDefines.xcconfigs to PlatformEnableCocoa.h, ensuring each one
871         also has a default value in PlatformEnable.h
872
873         To support the move, DerivedSources.make and generate-unified-sources.sh have been 
874         updated to generate the list of ENABLE_* features by directly from preprocessing 
875         Platform.h, rather than just getting the partial list from the xcconfig file.
876
877         * Configurations/FeatureDefines.xcconfig:
878         * DerivedSources.make:
879         * Scripts/generate-unified-sources.sh:
880
881 2020-02-07  Kate Cheney  <katherine_cheney@apple.com>
882
883         Update WebView category name to be more accurate
884         https://bugs.webkit.org/show_bug.cgi?id=207334
885         <rdar://problem/59224855>
886
887         Reviewed by Brent Fulgham.
888
889         * Shared/WebViewCategory.h:
890         * UIProcess/API/APIPageConfiguration.h:
891         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
892         (toWebKitWebViewCategory):
893         (toWKWebViewCategory):
894         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
895
896 2020-02-07  youenn fablet  <youenn@apple.com>
897
898         BackgroundProcessResponsivenessTimer should not be active if running active pages and service workers
899         https://bugs.webkit.org/show_bug.cgi?id=207264
900
901         Reviewed by Chris Dumez.
902
903         In case a service worker is running, the process might still be foreground if a page is running in the same process.
904         Not observable.
905
906         * UIProcess/BackgroundProcessResponsivenessTimer.cpp:
907         (WebKit::BackgroundProcessResponsivenessTimer::shouldBeActive const):
908
909 2020-02-07  Chris Dumez  <cdumez@apple.com>
910
911         Address post-landing review comments from Darin on r255989.
912
913         * UIProcess/WebProcessPool.cpp:
914         (WebKit::WebProcessPool::terminateServiceWorkerProcess):
915
916 2020-02-07  Chris Dumez  <cdumez@apple.com>
917
918         [IPC hardening] Update WebPasteboardProxy methods to validate their parameters
919         https://bugs.webkit.org/show_bug.cgi?id=207308
920         <rdar://problem/58632938>
921
922         Reviewed by Brent Fulgham.
923
924         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
925         (WebKit::WebPasteboardProxy::getPasteboardPathnamesForType):
926         (WebKit::WebPasteboardProxy::getPasteboardStringForType):
927         (WebKit::WebPasteboardProxy::getPasteboardStringsForType):
928         (WebKit::WebPasteboardProxy::getPasteboardBufferForType):
929         (WebKit::WebPasteboardProxy::setPasteboardStringForType):
930         (WebKit::WebPasteboardProxy::setPasteboardBufferForType):
931         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
932         (WebKit::WebPasteboardProxy::readStringFromPasteboard):
933         (WebKit::WebPasteboardProxy::readBufferFromPasteboard):
934
935 2020-02-07  youenn fablet  <youenn@apple.com>
936
937         Mandate UUID version 4 for mDNS ICE candidates
938         https://bugs.webkit.org/show_bug.cgi?id=207329
939
940         Reviewed by Alex Christensen.
941
942         * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
943         (WebKit::NetworkMDNSRegister::registerMDNSName):
944         Remove the count at the end of the mDNS name to make it a fully version 4 UUID.
945
946 2020-02-07  Patrick Griffis  <pgriffis@igalia.com>
947
948         [GTK][WPE] Add same-site cookie support
949         https://bugs.webkit.org/show_bug.cgi?id=204137
950
951         Reviewed by Carlos Garcia Campos.
952
953         Implements same-site cookie support in the soup backend.
954
955         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
956         (WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
957
958 2020-02-07  youenn fablet  <youenn@apple.com>
959
960         [Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder
961         https://bugs.webkit.org/show_bug.cgi?id=206582
962         <rdar://problem/58985368>
963
964         Reviewed by Eric Carlson.
965
966         Enable RemoteMediaRecorder only for systems supporting AVAssetWriterDelegate.
967
968         * GPUProcess/GPUConnectionToWebProcess.cpp:
969         (WebKit::GPUConnectionToWebProcess::didReceiveMessage):
970         * GPUProcess/GPUConnectionToWebProcess.h:
971         * GPUProcess/webrtc/RemoteMediaRecorder.cpp:
972         * GPUProcess/webrtc/RemoteMediaRecorder.h:
973         * GPUProcess/webrtc/RemoteMediaRecorder.messages.in:
974         * GPUProcess/webrtc/RemoteMediaRecorderManager.cpp:
975         * GPUProcess/webrtc/RemoteMediaRecorderManager.h:
976         * GPUProcess/webrtc/RemoteMediaRecorderManager.messages.in:
977         * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.h:
978         * WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp:
979         * WebProcess/GPU/webrtc/MediaRecorderPrivate.h:
980         * WebProcess/GPU/webrtc/MediaRecorderProvider.cpp:
981         (WebKit::MediaRecorderProvider::createMediaRecorderPrivate):
982
983 2020-02-06  Tim Horton  <timothy_horton@apple.com>
984
985         macCatalyst: Unnecessary I-beam over images in editable areas
986         https://bugs.webkit.org/show_bug.cgi?id=207370
987         <rdar://problem/59235429>
988
989         Reviewed by Wenson Hsieh.
990
991         * Shared/ios/InteractionInformationAtPosition.h:
992         * Shared/ios/InteractionInformationAtPosition.mm:
993         (WebKit::InteractionInformationAtPosition::encode const):
994         (WebKit::InteractionInformationAtPosition::decode):
995         * WebProcess/WebPage/ios/WebPageIOS.mm:
996         (WebKit::populateCaretContext):
997         Add a bit indicating whether the forced I-beam for editable contexts
998         should be used or not, based on whether it is adjacent to (or immediately
999         over) a replaced element.
1000
1001 2020-02-06  Brent Fulgham  <bfulgham@apple.com>
1002
1003         Build entitlements into GPU Process
1004         https://bugs.webkit.org/show_bug.cgi?id=207367
1005         <rdar://problem/59208411>
1006
1007         Reviewed by Geoffrey Garen.
1008
1009         When the new GPU process was added, we did not update the build system to add
1010         necessary entitlements, or to encode the sandbox name for process startup.
1011         This patch corrects these issues.
1012
1013         * Scripts/process-entitlements.sh:
1014
1015 2020-02-06  Yusuke Suzuki  <ysuzuki@apple.com>
1016
1017         ResourceLoadStatisticsDatabaseStore::dumpResourceLoadStatistics relies on the order of m_getAllDomainsStatement, which can be changed by HashTable's implementation
1018         https://bugs.webkit.org/show_bug.cgi?id=207348
1019
1020         Reviewed by Mark Lam.
1021
1022         It turns out that ResourceLoadStatisticsDatabaseStore::dumpResourceLoadStatistics's output
1023         is relying on HashTable's particular iteration order which is not guaranteed.
1024         This patch fixes this assumption by sorting domains before dumping.
1025
1026         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
1027         (WebKit::CompletionHandler<void):
1028
1029 2020-02-06  Jiewen Tan  <jiewen_tan@apple.com>
1030
1031         [WebAuthn] authenticatorGetAssertion should be sent without pinAuth if UV = "discouraged"
1032         https://bugs.webkit.org/show_bug.cgi?id=206547
1033         <rdar://problem/58768032>
1034
1035         Reviewed by Brent Fulgham.
1036
1037         Covered by new tests within existing files.
1038
1039         * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:
1040         (WebKit::CtapAuthenticator::makeCredential):
1041         (WebKit::CtapAuthenticator::getAssertion):
1042
1043 2020-02-06  Wenson Hsieh  <wenson_hsieh@apple.com>
1044
1045         WebPage::rangeForGranularityAtPoint always returns null in the case of CharacterGranularity
1046         https://bugs.webkit.org/show_bug.cgi?id=207350
1047         <rdar://problem/59239914>
1048
1049         Reviewed by Tim Horton.
1050
1051         Handle the character granularity case in `WebPage::rangeForGranularityAtPoint` by just returning a collapsed
1052         Range. Certain internal clients will have a need to place and update the text selection using character
1053         granularity; see radar for more details.
1054
1055         Test: UIWKInteractionViewProtocol.SelectTextWithCharacterGranularity
1056
1057         * UIProcess/ios/WKContentViewInteraction.mm:
1058         (-[WKContentView supportsTextSelectionWithCharacterGranularity]):
1059         * WebProcess/WebPage/ios/WebPageIOS.mm:
1060         (WebKit::WebPage::rangeForGranularityAtPoint):
1061
1062 2020-02-06  Jiewen Tan  <jiewen_tan@apple.com>
1063
1064         Adopt new SOAuthorizationOption constants
1065         https://bugs.webkit.org/show_bug.cgi?id=207186
1066         <rdar://problem/48909336>
1067
1068         Reviewed by Brent Fulgham.
1069
1070         No change of behaviors.
1071
1072         * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm:
1073         (WebKit::SOAuthorizationSession::continueStartAfterDecidePolicy):
1074
1075 2020-02-06  Brady Eidson  <beidson@apple.com>
1076
1077         Cleanup and promote WKContentWorld and its clients in WKWebView.
1078         https://bugs.webkit.org/show_bug.cgi?id=207351
1079
1080         Reviewed by Alex Christensen.
1081
1082         Renames and updated comments.
1083         
1084         API tests updated.
1085
1086         * Shared/Cocoa/APIObject.mm:
1087         (API::Object::newObject):
1088
1089         * SourcesCocoa.txt:
1090
1091         * UIProcess/API/Cocoa/WKContentWorld.h: Renamed from Source/WebKit/UIProcess/API/Cocoa/_WKContentWorld.h.
1092         * UIProcess/API/Cocoa/WKContentWorld.mm: Renamed from Source/WebKit/UIProcess/API/Cocoa/_WKContentWorld.mm.
1093         (+[WKContentWorld pageWorld]):
1094         (+[WKContentWorld defaultClientWorld]):
1095         (+[WKContentWorld worldWithName:]):
1096         (-[WKContentWorld dealloc]):
1097         (-[WKContentWorld name]):
1098         (-[WKContentWorld _apiObject]):
1099         * UIProcess/API/Cocoa/WKContentWorldInternal.h: Renamed from Source/WebKit/UIProcess/API/Cocoa/_WKContentWorldInternal.h.
1100
1101         * UIProcess/API/Cocoa/WKWebView.h:
1102         * UIProcess/API/Cocoa/WKWebView.mm:
1103         (-[WKWebView evaluateJavaScript:completionHandler:]):
1104         (-[WKWebView evaluateJavaScript:inContentWorld:completionHandler:]):
1105         (-[WKWebView callAsyncJavaScript:arguments:inContentWorld:completionHandler:]):
1106         (-[WKWebView _evaluateJavaScript:asAsyncFunction:withArguments:forceUserGesture:completionHandler:inWorld:]):
1107         (-[WKWebView _evaluateJavaScriptWithoutUserGesture:completionHandler:]):
1108         (-[WKWebView _callAsyncJavaScriptFunction:withArguments:inWorld:completionHandler:]): Deleted.
1109         (-[WKWebView _evaluateJavaScript:inWorld:completionHandler:]): Deleted.
1110         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1111
1112         * WebKit.xcodeproj/project.pbxproj:
1113
1114 2020-02-06  Fujii Hironori  <Hironori.Fujii@sony.com>
1115
1116         [Win][MiniBrowser] Accelerator keys don't work unless the main window is focused
1117         https://bugs.webkit.org/show_bug.cgi?id=207250
1118
1119         Reviewed by Alex Christensen.
1120
1121         * UIProcess/win/WebView.cpp:
1122         (WebKit::WebView::wndProc): Bubble up unhandled WM_COMMAND to the
1123         parent window.
1124
1125 2020-02-06  Chris Dumez  <cdumez@apple.com>
1126
1127         [WK2][iOS] Add WKWebviewConfiguration SPI to run client navigations at foreground priority, even if the view is background
1128         https://bugs.webkit.org/show_bug.cgi?id=207341
1129         <rdar://problem/59227077>
1130
1131         Reviewed by Geoff Garen.
1132
1133         Add WKWebviewConfiguration SPI to run client navigations at foreground priority, even if the view is background,
1134         as long as the application itself is foreground. The new SPI is:
1135         WKWebViewConfiguration._clientNavigationsRunAtForegroundPriority
1136
1137         The use case is that the client may choose to load something in an offscreen view and only show the view once the
1138         load is complete (to avoid flashing for e.g.). In such cases, it makes sense to use foreground priority for the
1139         load since it needs to complete as fast as possible, even though the view is technically background.
1140
1141         * UIProcess/API/APINavigation.h:
1142         (API::Navigation::setForegroundActivity):
1143         * UIProcess/API/APIPageConfiguration.cpp:
1144         (API::PageConfiguration::copy const):
1145         * UIProcess/API/APIPageConfiguration.h:
1146         (API::PageConfiguration::clientNavigationsRunAtForegroundPriority const):
1147         (API::PageConfiguration::setClientNavigationsRunAtForegroundPriority):
1148         (API::PageConfiguration::alwaysRunsAtForegroundPriority const):
1149         (API::PageConfiguration::alwaysRunsAtForegroundPriority): Deleted.
1150         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1151         (-[WKWebViewConfiguration _clientNavigationsRunAtForegroundPriority]):
1152         (-[WKWebViewConfiguration _setClientNavigationsRunAtForegroundPriority:]):
1153         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1154         * UIProcess/PageClient.h:
1155         * UIProcess/WebPageProxy.cpp:
1156         (WebKit::WebPageProxy::loadRequest):
1157         (WebKit::WebPageProxy::loadFile):
1158         (WebKit::WebPageProxy::loadData):
1159         (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
1160         (WebKit::WebPageProxy::didFinishLoadForFrame):
1161         (WebKit::WebPageProxy::didFailLoadForFrame):
1162         * UIProcess/WebPageProxy.h:
1163         * UIProcess/ios/PageClientImplIOS.h:
1164         * UIProcess/ios/PageClientImplIOS.mm:
1165         (WebKit::PageClientImpl::isApplicationVisible):
1166         * UIProcess/ios/WebPageProxyIOS.mm:
1167         (WebKit::WebPageProxy::shouldUseForegroundPriorityForClientNavigation const):
1168
1169 2020-02-06  Chris Dumez  <cdumez@apple.com>
1170
1171         REGRESSION (r254706): Crash under WebProcessPool::terminateServiceWorkerProcess()
1172         https://bugs.webkit.org/show_bug.cgi?id=207354
1173         <rdar://problem/59184818>
1174
1175         Reviewed by Geoffrey Garen.
1176
1177         No new tests, not easily testable AFAIK since this happens on failure to send sync IPC to
1178         the service worker when terminating it.
1179
1180         * UIProcess/WebProcessPool.cpp:
1181         (WebKit::WebProcessPool::terminateServiceWorkerProcess):
1182         'auto' resolved to 'WeakPtr<WebProcessProxy>' in this method and the call to
1183         disableServiceWorkers() could cause the process to get destroyed. We would then
1184         do a null dereference on the next line.
1185
1186 2020-02-06  Chris Dumez  <cdumez@apple.com>
1187
1188         Unreviewed, rolling out r255955.
1189
1190         Caused API test failures on iOS
1191
1192         Reverted changeset:
1193
1194         "[IPC hardening] Update WebPasteboardProxy methods to validate
1195         their parameters"
1196         https://bugs.webkit.org/show_bug.cgi?id=207308
1197         https://trac.webkit.org/changeset/255955
1198
1199 2020-02-06  Commit Queue  <commit-queue@webkit.org>
1200
1201         Unreviewed, rolling out r255910, r255970, and r255972.
1202         https://bugs.webkit.org/show_bug.cgi?id=207345
1203
1204         Broke internal builds (Requested by ryanhaddad on #webkit).
1205
1206         Reverted changesets:
1207
1208         "[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder"
1209         https://bugs.webkit.org/show_bug.cgi?id=206582
1210         https://trac.webkit.org/changeset/255910
1211
1212         "[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder"
1213         https://bugs.webkit.org/show_bug.cgi?id=206582
1214         https://trac.webkit.org/changeset/255970
1215
1216         "[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder"
1217         https://bugs.webkit.org/show_bug.cgi?id=206582
1218         https://trac.webkit.org/changeset/255972
1219
1220 2020-02-06  Patrick Griffis  <pgriffis@igalia.com>
1221
1222         [GTK][WPE] Re-add flatpak sandbox support
1223         https://bugs.webkit.org/show_bug.cgi?id=204732
1224
1225         Reviewed by Michael Catanzaro.
1226
1227         This brings back the Flatpak based sandbox now that upstream has added
1228         features to their spawn portal to accomodate our needs.
1229
1230         * SourcesGTK.txt:
1231         * SourcesWPE.txt:
1232         * UIProcess/Launcher/glib/FlatpakLauncher.cpp: Added.
1233         (WebKit::flatpakSpawn):
1234         * UIProcess/Launcher/glib/FlatpakLauncher.h: Added.
1235         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
1236         (WebKit::isFlatpakSpawnUsable):
1237         (WebKit::isInsideFlatpak):
1238         (WebKit::ProcessLauncher::launchProcess):
1239
1240 2020-02-06  Brent Fulgham  <bfulgham@apple.com>
1241
1242         Prevent navigating top level frames to Data URLs
1243         https://bugs.webkit.org/show_bug.cgi?id=206962
1244         <rdar://problem/56770676>
1245
1246         Reviewed by Youenn Fablet.
1247
1248         Expose a new off-by-default preference to allow top-level navigation to Data URIs.
1249
1250         Tests:  fast/loader/data-url-frame-allowed.html, fast/loader/data-url-load-denied.html
1251
1252         * Shared/WebPreferences.yaml:
1253         * UIProcess/API/C/WKPreferences.cpp:
1254         (WKPreferencesSetTopNavigationToDataURLsAllowed):
1255         (WKPreferencesGetTopNavigationToDataURLsAllowed):
1256         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1257         * UIProcess/API/Cocoa/WKPreferences.mm:
1258         (-[WKPreferences _setTopNavigationToDataURLsAllowed:]):
1259         (-[WKPreferences _topNavigationToDataURLsAllowed]):
1260         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1261         * UIProcess/API/Cocoa/WKWebView.mm:
1262         (-[WKWebView _setupPageConfiguration:]):
1263         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1264         (-[WKWebViewConfiguration init]):
1265         (-[WKWebViewConfiguration copyWithZone:]):
1266         (-[WKWebViewConfiguration _allowTopNavigationToDataURLs]):
1267         (-[WKWebViewConfiguration _setAllowTopNavigationToDataURLs:]):
1268         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1269         * UIProcess/Inspector/mac/WKInspectorViewController.mm:
1270         (-[WKInspectorViewController configuration]):
1271
1272 2020-02-06  Alex Christensen  <achristensen@webkit.org>
1273
1274         Remove unused SPI WKWebViewConfiguration._treatsSHA1SignedCertificatesAsInsecure
1275         https://bugs.webkit.org/show_bug.cgi?id=207314
1276
1277         Reviewed by Youenn Fablet.
1278
1279         The transition period is over.  SHA1 certificates are insecure.
1280
1281         * UIProcess/API/APIPageConfiguration.cpp:
1282         (API::PageConfiguration::copy const):
1283         * UIProcess/API/APIPageConfiguration.h:
1284         (API::PageConfiguration::treatsSHA1SignedCertificatesAsInsecure): Deleted.
1285         (API::PageConfiguration::setTreatsSHA1SignedCertificatesAsInsecure): Deleted.
1286         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1287         (-[WKWebViewConfiguration _treatsSHA1SignedCertificatesAsInsecure]): Deleted.
1288         (-[WKWebViewConfiguration _setTreatsSHA1SignedCertificatesAsInsecure:]): Deleted.
1289         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1290         * UIProcess/WebPageProxy.cpp:
1291         (WebKit::WebPageProxy::WebPageProxy):
1292         (WebKit::WebPageProxy::didCommitLoadForFrame):
1293         * UIProcess/WebPageProxy.h:
1294
1295 2020-02-06  Chris Dumez  <cdumez@apple.com>
1296
1297         [IPC hardening] Update WebPasteboardProxy methods to validate their parameters
1298         https://bugs.webkit.org/show_bug.cgi?id=207308
1299         <rdar://problem/58632938>
1300
1301         Reviewed by Alex Christensen.
1302
1303         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
1304         (WebKit::WebPasteboardProxy::getPasteboardTypes):
1305         (WebKit::WebPasteboardProxy::getPasteboardPathnamesForType):
1306         (WebKit::WebPasteboardProxy::getPasteboardStringForType):
1307         (WebKit::WebPasteboardProxy::getPasteboardStringsForType):
1308         (WebKit::WebPasteboardProxy::getPasteboardBufferForType):
1309         (WebKit::WebPasteboardProxy::pasteboardCopy):
1310         (WebKit::WebPasteboardProxy::getPasteboardChangeCount):
1311         (WebKit::WebPasteboardProxy::getPasteboardColor):
1312         (WebKit::WebPasteboardProxy::getPasteboardURL):
1313         (WebKit::WebPasteboardProxy::addPasteboardTypes):
1314         (WebKit::WebPasteboardProxy::setPasteboardTypes):
1315         (WebKit::WebPasteboardProxy::setPasteboardURL):
1316         (WebKit::WebPasteboardProxy::setPasteboardColor):
1317         (WebKit::WebPasteboardProxy::setPasteboardStringForType):
1318         (WebKit::WebPasteboardProxy::setPasteboardBufferForType):
1319         (WebKit::WebPasteboardProxy::getNumberOfFiles):
1320         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
1321         (WebKit::WebPasteboardProxy::writeCustomData):
1322         (WebKit::WebPasteboardProxy::allPasteboardItemInfo):
1323         (WebKit::WebPasteboardProxy::informationForItemAtIndex):
1324         (WebKit::WebPasteboardProxy::getPasteboardItemsCount):
1325         (WebKit::WebPasteboardProxy::readStringFromPasteboard):
1326         (WebKit::WebPasteboardProxy::readURLFromPasteboard):
1327         (WebKit::WebPasteboardProxy::readBufferFromPasteboard):
1328         (WebKit::WebPasteboardProxy::writeURLToPasteboard):
1329         (WebKit::WebPasteboardProxy::writeWebContentToPasteboard):
1330         (WebKit::WebPasteboardProxy::writeImageToPasteboard):
1331         (WebKit::WebPasteboardProxy::writeStringToPasteboard):
1332         (WebKit::WebPasteboardProxy::updateSupportedTypeIdentifiers):
1333
1334 2020-02-06  Chris Dumez  <cdumez@apple.com>
1335
1336         [IPC Hardening] Protect against bad identifier in WebPageProxy::DidInsertAttachmentWithIdentifier()
1337         https://bugs.webkit.org/show_bug.cgi?id=207311
1338         <rdar://problem/58632517>
1339
1340         Reviewed by Alex Christensen.
1341
1342         * UIProcess/WebPageProxy.cpp:
1343
1344 2020-02-06  youenn fablet  <youenn@apple.com>
1345
1346         [Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder
1347         https://bugs.webkit.org/show_bug.cgi?id=206582
1348         <rdar://problem/58985368>
1349
1350         Reviewed by Eric Carlson.
1351
1352         Enable RemoteMediaRecorder only for systems supporting AVAssetWriterDelegate.
1353
1354         * GPUProcess/GPUConnectionToWebProcess.cpp:
1355         (WebKit::GPUConnectionToWebProcess::didReceiveMessage):
1356         * GPUProcess/GPUConnectionToWebProcess.h:
1357         * GPUProcess/webrtc/RemoteMediaRecorder.cpp:
1358         * GPUProcess/webrtc/RemoteMediaRecorder.h:
1359         * GPUProcess/webrtc/RemoteMediaRecorder.messages.in:
1360         * GPUProcess/webrtc/RemoteMediaRecorderManager.cpp:
1361         * GPUProcess/webrtc/RemoteMediaRecorderManager.h:
1362         * GPUProcess/webrtc/RemoteMediaRecorderManager.messages.in:
1363         * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.h:
1364         * WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp:
1365         * WebProcess/GPU/webrtc/MediaRecorderPrivate.h:
1366         * WebProcess/GPU/webrtc/MediaRecorderProvider.cpp:
1367         (WebKit::MediaRecorderProvider::createMediaRecorderPrivate):
1368
1369 2020-02-06  youenn fablet  <youenn@apple.com>
1370
1371         ServiceWorkerProvider::registerServiceWorkerClients is no longer needed
1372         https://bugs.webkit.org/show_bug.cgi?id=207193
1373
1374         Reviewed by Chris Dumez.
1375
1376         Remove the request from WebProcessPool to register all service worker clients at launch of the first service worker process.
1377         This is no longer needed and does not scale since our service workers are launched in different processes nowadays.
1378
1379         In case network process crashes, WebProcess will need to reregister their service worker clients.
1380         This is lazily done when WebProcess tries to reconnect to the Network Process.
1381
1382         * UIProcess/WebProcessPool.cpp:
1383         (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
1384         * WebProcess/WebProcess.cpp:
1385         (WebKit::WebProcess::ensureNetworkProcessConnection):
1386         * WebProcess/WebProcess.h:
1387         * WebProcess/WebProcess.messages.in:
1388
1389 2020-02-05  Wenson Hsieh  <wenson_hsieh@apple.com>
1390
1391         [iOS] Provide a way to suppress software keyboards on WKWebView's WKContentView
1392         https://bugs.webkit.org/show_bug.cgi?id=207272
1393         <rdar://problem/59190828>
1394
1395         Reviewed by Tim Horton.
1396
1397         Allow SPI clients to suppress the software keyboard using -_setSuppressSoftwareKeyboard: on WKWebView by
1398         propagating the call to the WKContentView, which is the view that actually becomes first responder when an
1399         element (e.g. a form control) is focused.
1400
1401         Test: KeyboardInputTests.SuppressSoftwareKeyboard
1402
1403         * Platform/spi/ios/UIKitSPI.h:
1404         * UIProcess/API/ios/WKWebViewIOS.mm:
1405         (-[WKWebView _setSuppressSoftwareKeyboard:]):
1406
1407 2020-02-05  Don Olmstead  <don.olmstead@sony.com>
1408
1409         [PlayStation] Miscellaneous build fixes February 2020 edition
1410         https://bugs.webkit.org/show_bug.cgi?id=207312
1411
1412         Unreviewed build fix.
1413
1414         * NetworkProcess/NetworkDataTaskBlob.cpp: Add missing include.
1415         * UIProcess/Downloads/DownloadProxyMap.h: Add missing forward declaration.
1416
1417 2020-02-05  Jer Noble  <jer.noble@apple.com>
1418
1419         Adopt MTOverrideShouldPlayHDRVideo()
1420         https://bugs.webkit.org/show_bug.cgi?id=207275
1421         <rdar://problem/58837093>
1422
1423         Reviewed by Eric Carlson.
1424
1425         The WebProcess sandbox can block access to the services necessary for MediaToolbox to determine whether
1426         the current display is capable of displaying HDR. Rather than opening up the sandbox, provide the information
1427         gathered by the UIProcess by way of MTOverrideShouldPlayHDRVideo().
1428
1429         * WebProcess/WebPage/WebPage.cpp:
1430         (WebKit::WebPage::windowScreenDidChange):
1431         (WebKit::WebPage::displayID const):
1432         * WebProcess/WebPage/WebPage.h:
1433         * WebProcess/WebProcess.cpp:
1434         (WebKit::WebProcess::setScreenProperties): Deleted.
1435         * WebProcess/WebProcess.h:
1436         * WebProcess/cocoa/WebProcessCocoa.mm:
1437         (WebKit::WebProcess::setScreenProperties):
1438         (WebKit::WebProcess::updatePageScreenProperties):
1439
1440 2020-02-05  Wenson Hsieh  <wenson_hsieh@apple.com>
1441
1442         [macCatalyst] Incorrect IBeam cursor when selecting text on Wikipedia
1443         https://bugs.webkit.org/show_bug.cgi?id=207299
1444         <rdar://problem/59200545>
1445
1446         Reviewed by Tim Horton.
1447
1448         After r255827, if EventHandler selects an IBeam cursor at the position information request location, we will
1449         always attempt to show a caret at that location, whose height is the height of the editing caret for that
1450         visible position. However, this means that:
1451
1452         -   It's possible for the caret to be incorrectly sized if the caret is before a large replaced element, such as
1453             a table. Since the request location is also outside of any line rect, it doesn't make sense to use the caret
1454             height for the height of the cursor. Instead, fall back to computed line height. This fixes an issue on
1455             en.wikipedia.org where the line rect would sometimes update to an enormous size when selecting text, since
1456             the caret would temporarily hover over an editing position that is before a large table.
1457
1458         -   This fallback path completely negates certain cursor behaviors; partially restore this behavior by making it
1459             so that in the case where the cursor is in editable content and the line caret first line from the top of
1460             the hit-tested node already contains the request point, don't bother trying to recenter the line rect to be
1461             right over the request point.
1462
1463         * WebProcess/WebPage/ios/WebPageIOS.mm:
1464         (WebKit::populateCaretContext):
1465
1466 2020-02-05  Chris Dumez  <cdumez@apple.com>
1467
1468         Regression(r248734) StorageAreaMap objects are getting leaked
1469         https://bugs.webkit.org/show_bug.cgi?id=207073
1470         <rdar://problem/59168065>
1471
1472         Reviewed by Darin Adler.
1473
1474         Make sure that StorageAreaMap objects are getting removed from the HashMap
1475         in StorageNamespaceImpl, once they no longer have any users.
1476
1477         * WebProcess/WebStorage/StorageAreaImpl.cpp:
1478         (WebKit::StorageAreaImpl::StorageAreaImpl):
1479         (WebKit::StorageAreaImpl::~StorageAreaImpl):
1480         * WebProcess/WebStorage/StorageAreaMap.cpp:
1481         (WebKit::StorageAreaMap::incrementUseCount):
1482         (WebKit::StorageAreaMap::decrementUseCount):
1483         * WebProcess/WebStorage/StorageAreaMap.h:
1484         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
1485         (WebKit::StorageNamespaceImpl::destroyStorageAreaMap):
1486         (WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap): Deleted.
1487         * WebProcess/WebStorage/StorageNamespaceImpl.h:
1488         (WebKit::StorageNamespaceImpl::storageType const): Deleted.
1489         (WebKit::StorageNamespaceImpl::storageNamespaceID const): Deleted.
1490         (WebKit::StorageNamespaceImpl::topLevelOrigin const): Deleted.
1491         (WebKit::StorageNamespaceImpl::quotaInBytes const): Deleted.
1492
1493 2020-02-05  Per Arne Vollan  <pvollan@apple.com>
1494
1495         [iOS] Do not create sandbox reports when the UI process cannot issue extensions to diagnostics service
1496         https://bugs.webkit.org/show_bug.cgi?id=207279
1497         <rdar://problem/59030957>
1498         
1499         Reviewed by Brent Fulgham.
1500
1501         Do not create sandbox reports when the UI process cannot issue mach extensions to the diagnostics service.
1502         The majority of clients are capable of doing this.
1503
1504         No new tests, since it is not trivial to test if no sandbox reports are generated for a violation.
1505
1506         * Shared/Cocoa/SandboxExtensionCocoa.mm:
1507         (WebKit::SandboxExtensionImpl::create):
1508         (WebKit::SandboxExtensionImpl::sandboxExtensionForType):
1509         (WebKit::SandboxExtensionImpl::SandboxExtensionImpl):
1510         (WebKit::SandboxExtension::createHandleForMachLookup):
1511         * Shared/SandboxExtension.h:
1512         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1513         (WebKit::WebProcessPool::platformInitializeWebProcess):
1514
1515 2020-02-05  Chris Dumez  <cdumez@apple.com>
1516
1517         [IPC hardening] Protect against bad identifier in CacheStorageEngineConnection::reference() / dereference()
1518         https://bugs.webkit.org/show_bug.cgi?id=207302
1519         <rdar://problem/59016099>
1520
1521         Reviewed by Alex Christensen.
1522
1523         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
1524         (WebKit::CacheStorageEngineConnection::reference):
1525         (WebKit::CacheStorageEngineConnection::dereference):
1526
1527 2020-02-05  Chris Dumez  <cdumez@apple.com>
1528
1529         [IPC hardening] Protect against bad parameters in NetworkRTCProvider::createResolver()
1530         https://bugs.webkit.org/show_bug.cgi?id=207301
1531         <rdar://problem/59011449>
1532
1533         Reviewed by Alex Christensen.
1534
1535         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
1536         (WebKit::NetworkRTCProvider::createResolver):
1537
1538 2020-02-05  Patrick Griffis  <pgriffis@igalia.com>
1539
1540         [GTK][WPE] Add more fontconfig paths into the sandbox
1541         https://bugs.webkit.org/show_bug.cgi?id=207293
1542
1543         Reviewed by Michael Catanzaro.
1544
1545         These paths were reported to be used on Debian.
1546
1547         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
1548         (WebKit::bindFonts):
1549
1550 2020-02-05  Chris Dumez  <cdumez@apple.com>
1551
1552         [IPC hardening] Protect against bad originIdentifier String in WebPageProxy::reachedApplicationCacheOriginQuota() / requestGeolocationPermissionForFrame()
1553         https://bugs.webkit.org/show_bug.cgi?id=207292
1554         <rdar://problem/58345601>
1555
1556         Reviewed by David Kilzer.
1557
1558         * UIProcess/WebPageProxy.cpp:
1559
1560 2020-02-05  Jiewen Tan  <jiewen_tan@apple.com>
1561
1562         Defer ending AppSSO sheets til NSWindowDidDeminiaturize or NSApplicationDidUnhide
1563         https://bugs.webkit.org/show_bug.cgi?id=207173
1564         <rdar://problem/55669065>
1565
1566         Reviewed by Brent Fulgham.
1567
1568         AppKit has a bug that [m_sheetWindow sheetParent] is null if the parent is minimized or the host app is hidden.
1569         SheetParent is used to endSheet. Therefore, WebKit cannot dismiss AppSSO UIs in the above two cases if asked
1570         by extensions.
1571
1572         This patch implements a workaround to detect those two cases and defer the endSheet til NSWindowDidDeminiaturize
1573         or NSApplicationDidUnhide is received.
1574
1575         Covered by API tests.
1576
1577         * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.h:
1578         * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm:
1579         (WebKit::SOAuthorizationSession::dismissViewController):
1580         * UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.mm:
1581         (WebKit::SubFrameSOAuthorizationSession::abortInternal):
1582         Treat abort like falling back to the web path for sub frame case given displaying an empty
1583         iframe after aborting seems bad.
1584
1585 2020-02-05  Chris Dumez  <cdumez@apple.com>
1586
1587         [IPC Hardening] Protect against targetId String being invalid in WebPageProxy::createInspectorTarget() / destroyInspectorTarget()
1588         https://bugs.webkit.org/show_bug.cgi?id=207288
1589         <rdar://problem/57645953>
1590
1591         Reviewed by Geoffrey Garen.
1592
1593         * UIProcess/WebPageProxy.cpp:
1594         (WebKit::WebPageProxy::createInspectorTarget):
1595         (WebKit::WebPageProxy::destroyInspectorTarget):
1596
1597 2020-02-05  Chris Dumez  <cdumez@apple.com>
1598
1599         [IPC hardening] Protect against m_inspectorPage being null inWebInspectorProxy::attach()
1600         https://bugs.webkit.org/show_bug.cgi?id=207289
1601         <rdar://problem/58419789>
1602
1603         Reviewed by David Kilzer.
1604
1605         * UIProcess/Inspector/WebInspectorProxy.cpp:
1606         (WebKit::WebInspectorProxy::attach):
1607
1608 2020-02-05  Chris Dumez  <cdumez@apple.com>
1609
1610         [IPC Hardening] Protect against m_inspectorPage being null in WebInspectorProxy::detach()
1611         https://bugs.webkit.org/show_bug.cgi?id=207286
1612         <rdar://problem/55422296>
1613
1614         Reviewed by David Kilzer.
1615
1616         * UIProcess/Inspector/WebInspectorProxy.cpp:
1617         (WebKit::WebInspectorProxy::detach):
1618
1619 2020-02-05  Brent Fulgham  <bfulgham@apple.com>
1620
1621         Update sandbox to allow communication with dnssd service
1622         https://bugs.webkit.org/show_bug.cgi?id=207276
1623         <rdar://problem/59158405>
1624
1625         Reviewed by Per Arne Vollan.
1626
1627         Testing and telemetry indicates that we need access to the DNSSD mach service in our Network Process
1628
1629         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1630         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
1631
1632 2020-02-05  Chris Dumez  <cdumez@apple.com>
1633
1634         [IPC Hardening] Protect against null String under WebInspectorProxy::save() / WebInspectorProxy::append()
1635         https://bugs.webkit.org/show_bug.cgi?id=207284
1636         <rdar://problem/55271616>
1637
1638         Reviewed by David Kilzer.
1639
1640         * UIProcess/Inspector/WebInspectorProxy.cpp:
1641         (WebKit::WebInspectorProxy::save):
1642         (WebKit::WebInspectorProxy::append):
1643
1644 2020-02-05  Chris Dumez  <cdumez@apple.com>
1645
1646         [IPC Hardening] Protect against m_inspectorPage being null in WebInspectorProxy::setAttachedWindowHeight() / setAttachedWindowWidth()
1647         https://bugs.webkit.org/show_bug.cgi?id=207287
1648         <rdar://problem/55422919>
1649
1650         Reviewed by Geoffrey Garen.
1651
1652         * UIProcess/Inspector/WebInspectorProxy.cpp:
1653         (WebKit::WebInspectorProxy::setAttachedWindowHeight):
1654         (WebKit::WebInspectorProxy::setAttachedWindowWidth):
1655
1656 2020-02-05  Chris Dumez  <cdumez@apple.com>
1657
1658         [IPC Hardening] Protect against m_inspectedPage / m_inspectorPage being null in WebInspectorProxy::resetState()
1659         https://bugs.webkit.org/show_bug.cgi?id=207285
1660         <rdar://problem/55420035>
1661
1662         Reviewed by David Kilzer.
1663
1664         * UIProcess/Inspector/WebInspectorProxy.cpp:
1665         (WebKit::WebInspectorProxy::resetState):
1666
1667 2020-02-05  Chris Dumez  <cdumez@apple.com>
1668
1669         [IPC Hardening] Protect against bad RegistrableDomain under WebProcessProxy::didCollectPrewarmInformation()
1670         https://bugs.webkit.org/show_bug.cgi?id=207281
1671         <rdar://problem/55318108>
1672
1673         Reviewed by Geoffrey Garen.
1674
1675         * UIProcess/WebProcessProxy.cpp:
1676         (WebKit::WebProcessProxy::didCollectPrewarmInformation):
1677
1678 2020-02-05  Chris Dumez  <cdumez@apple.com>
1679
1680         [IPC Hardening] Protect against bad ClientOrigin under Engine::readCachesFromDisk()
1681         https://bugs.webkit.org/show_bug.cgi?id=207280
1682         <rdar://problem/59013832>
1683
1684         Reviewed by Geoffrey Garen.
1685
1686         Protect against bad ClientOrigin under Engine::readCachesFromDisk(), as it is coming from
1687         IPC from the WebContent process.
1688
1689         * NetworkProcess/cache/CacheStorageEngine.cpp:
1690         (WebKit::CacheStorage::Engine::readCachesFromDisk):
1691
1692 2020-02-05  Alex Christensen  <achristensen@webkit.org>
1693
1694         Make WKWebView._negotiatedLegacyTLS accurate when loading main resouorce from network or cache
1695         https://bugs.webkit.org/show_bug.cgi?id=207207
1696
1697         Reviewed by Chris Dumez.
1698
1699         In PageLoadState::didCommitLoad, I was resetting the value of _negotiatedLegacyTLS to false.
1700         That created a race condition when loading the main resource because the NetworkProcess would
1701         message the UIProcess setting _negotiatedLegacyTLS to false, while the NetworkProcess would
1702         message the WebProcess which would message the UIProcess to call PageLoadState::didCommitLoad
1703         which would reset it to false.  Now it resets it to the correct value, whatever it is.
1704
1705         Updating the ResourceResponseBase serialization code has the desirable side effect that the disk
1706         cache will remember whether legacy TLS was used to fetch each resource.  This will make it so
1707         _negotiatedLegacyTLS is true if we read content from the disk cache that was originally fetched
1708         using legacy TLS.
1709
1710         In order to not increase the memory footprint of ResourceResponse, I changed m_httpStatusCode from
1711         an int to a short.  It just needs to be able to cover the values 0-600 or so, which really only needs 10 bits.
1712
1713         Covered by new API tests.
1714
1715         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
1716         (WebKit::NetworkCORSPreflightChecker::didReceiveResponse):
1717         * NetworkProcess/NetworkCORSPreflightChecker.h:
1718         * NetworkProcess/NetworkDataTask.cpp:
1719         (WebKit::NetworkDataTask::didReceiveResponse):
1720         (WebKit::NetworkDataTask::negotiatedLegacyTLS const): Deleted.
1721         * NetworkProcess/NetworkDataTask.h:
1722         (WebKit::NetworkDataTaskClient::negotiatedLegacyTLS const): Deleted.
1723         * NetworkProcess/NetworkDataTaskBlob.cpp:
1724         (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse):
1725         * NetworkProcess/NetworkLoad.cpp:
1726         (WebKit::NetworkLoad::didReceiveResponse):
1727         (WebKit::NetworkLoad::notifyDidReceiveResponse):
1728         (WebKit::NetworkLoad::throttleDelayCompleted):
1729         (WebKit::NetworkLoad::negotiatedLegacyTLS const): Deleted.
1730         * NetworkProcess/NetworkLoad.h:
1731         * NetworkProcess/NetworkResourceLoader.h:
1732         * NetworkProcess/PingLoad.cpp:
1733         (WebKit::PingLoad::didReceiveResponse):
1734         * NetworkProcess/PingLoad.h:
1735         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
1736         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1737         (WebKit::NetworkDataTaskCocoa::didReceiveResponse):
1738         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1739         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
1740         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
1741         (WebKit::NetworkDataTaskCurl::invokeDidReceiveResponse):
1742         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1743         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse):
1744         * UIProcess/PageLoadState.cpp:
1745         (WebKit::PageLoadState::didCommitLoad):
1746         * UIProcess/PageLoadState.h:
1747         * UIProcess/ProvisionalPageProxy.cpp:
1748         (WebKit::ProvisionalPageProxy::didCommitLoadForFrame):
1749         * UIProcess/ProvisionalPageProxy.h:
1750         * UIProcess/WebPageProxy.cpp:
1751         (WebKit::WebPageProxy::commitProvisionalPage):
1752         (WebKit::WebPageProxy::didCommitLoadForFrame):
1753         * UIProcess/WebPageProxy.h:
1754         * UIProcess/WebPageProxy.messages.in:
1755         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1756         (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
1757
1758 2020-02-05  Brady Eidson  <beidson@apple.com>
1759
1760         _WKDownload should expose the originating FrameInfo.
1761         <rdar://problem/58022576> and https://bugs.webkit.org/show_bug.cgi?id=207185
1762
1763         Reviewed by Geoff Garen.
1764
1765         Covered by new API test.
1766         
1767         For the cases where a navigation is converted into a download, include the relevant
1768         WKFrameInfo on the _WKDownload object.
1769
1770         * UIProcess/API/APIFrameInfo.h:
1771         * UIProcess/API/Cocoa/_WKDownload.h:
1772         * UIProcess/API/Cocoa/_WKDownload.mm:
1773         (-[_WKDownload originatingFrameInfo]):
1774         * UIProcess/Downloads/DownloadProxy.cpp:
1775         (WebKit::generateDownloadID):
1776         (WebKit::DownloadProxy::DownloadProxy):
1777         (WebKit::DownloadProxy::create): Deleted.
1778         (WebKit::DownloadProxy::setOriginatingPage): Deleted.
1779         * UIProcess/Downloads/DownloadProxy.h:
1780         (WebKit::DownloadProxy::create):
1781         (WebKit::DownloadProxy::frameInfo):
1782         * UIProcess/Downloads/DownloadProxyMap.cpp:
1783         (WebKit::DownloadProxyMap::createDownloadProxy):
1784         * UIProcess/Downloads/DownloadProxyMap.h:
1785         * UIProcess/Network/NetworkProcessProxy.cpp:
1786         (WebKit::NetworkProcessProxy::createDownloadProxy):
1787         * UIProcess/Network/NetworkProcessProxy.h:
1788         * UIProcess/WebPageProxy.cpp:
1789         (WebKit::WebPageProxy::receivedPolicyDecision):
1790         * UIProcess/WebProcessPool.cpp:
1791         (WebKit::WebProcessPool::download):
1792         (WebKit::WebProcessPool::resumeDownload):
1793         (WebKit::WebProcessPool::createDownloadProxy):
1794         * UIProcess/WebProcessPool.h:
1795
1796 2020-02-05  Wenson Hsieh  <wenson_hsieh@apple.com>
1797
1798         [macCatalyst] IBeam cursor doesn't show up when hovering over text form controls prior to editing
1799         https://bugs.webkit.org/show_bug.cgi?id=207268
1800         <rdar://problem/59188152>
1801
1802         Reviewed by Tim Horton.
1803
1804         On macCatalyst, when hovering over textareas and input fields that have not been edited yet, the cursor fails to
1805         change to an IBeam and instead falls back to the default style. Even though `EventHandler::selectCursor()`
1806         returns `IBeam`, we end up not actually using an IBeam because the position information's `lineCaretExtent` is
1807         an empty rect, which means the caret height is 0 and, more importantly, the line rect will not contain the
1808         request point.
1809
1810         The line rect is empty in text fields that have not been edited yet because the form control's inner plaintext
1811         contenteditable div (embedded in the shadow root) does not contain any child renderers with a non-zero height.
1812         Even if it did, however, the element may still be much taller than the combined height of the inner div's
1813         children, so the line rect may still not contain the position information request point (this is most easily
1814         noticeable when focusing a textarea, typing a few letters, and then moving the cursor to near the bottom of the
1815         textarea element).
1816
1817         To fix this, add a fallback path for the scenario where we want to show an IBeam, but fail to find line rects
1818         that contain the request point. Instead, we still show an IBeam, but simply fake the lineCaretExtent to be an
1819         element-wide rect that is the height of the caret, and is also vertically centered about the request point.
1820
1821         * WebProcess/WebPage/ios/WebPageIOS.mm:
1822         (WebKit::populateCaretContext):
1823
1824 2020-02-05  Commit Queue  <commit-queue@webkit.org>
1825
1826         Unreviewed, rolling out r255818.
1827         https://bugs.webkit.org/show_bug.cgi?id=207270
1828
1829         It is breaking some Mac builds (Requested by youenn on
1830         #webkit).
1831
1832         Reverted changeset:
1833
1834         "[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder"
1835         https://bugs.webkit.org/show_bug.cgi?id=206582
1836         https://trac.webkit.org/changeset/255818
1837
1838 2020-02-05  youenn fablet  <youenn@apple.com>
1839
1840         [Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder
1841         https://bugs.webkit.org/show_bug.cgi?id=206582
1842         <rdar://problem/58985368>
1843
1844         Reviewed by Eric Carlson.
1845
1846         Enable RemoteMediaRecorder only for systems supporting AVAssetWriterDelegate.
1847
1848         * GPUProcess/GPUConnectionToWebProcess.cpp:
1849         (WebKit::GPUConnectionToWebProcess::didReceiveMessage):
1850         * GPUProcess/GPUConnectionToWebProcess.h:
1851         * GPUProcess/webrtc/RemoteMediaRecorder.cpp:
1852         * GPUProcess/webrtc/RemoteMediaRecorder.h:
1853         * GPUProcess/webrtc/RemoteMediaRecorder.messages.in:
1854         * GPUProcess/webrtc/RemoteMediaRecorderManager.cpp:
1855         * GPUProcess/webrtc/RemoteMediaRecorderManager.h:
1856         * GPUProcess/webrtc/RemoteMediaRecorderManager.messages.in:
1857         * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.h:
1858         * WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp:
1859         * WebProcess/GPU/webrtc/MediaRecorderPrivate.h:
1860         * WebProcess/GPU/webrtc/MediaRecorderProvider.cpp:
1861         (WebKit::MediaRecorderProvider::createMediaRecorderPrivate):
1862
1863 2020-02-05  Chris Dumez  <cdumez@apple.com>
1864
1865         Unreviewed, rolling out r255706.
1866
1867         Caused assertions in API tests
1868
1869         Reverted changeset:
1870
1871         "Partial revert of r248734 to fix leak of StorageAreaMaps"
1872         https://bugs.webkit.org/show_bug.cgi?id=207073
1873         https://trac.webkit.org/changeset/255706
1874
1875 2020-02-05  Chris Dumez  <cdumez@apple.com>
1876
1877         Unreviewed, follow-up assertion fix after r255662.
1878
1879         * UIProcess/WebProcessPool.cpp:
1880         (WebKit::WebProcessPool::initializeNewWebProcess):
1881
1882 2020-02-04  Wenson Hsieh  <wenson_hsieh@apple.com>
1883
1884         REGRESSION (r251320): Can't double tap to select word in Notes on iCloud.com
1885         https://bugs.webkit.org/show_bug.cgi?id=207239
1886         <rdar://problem/58686015>
1887
1888         Reviewed by Tim Horton.
1889
1890         Following r251320, all synthetic mouse events on iOS additionally dispatched corresponding pointer events. This
1891         led to duplicate "pointerdown"/"pointerup" events dispatched with every tap. r253878 fixed this by avoiding
1892         pointer event dispatch for synthetically generated mouse events (and made this determination by consulting
1893         `syntheticClickType()`).
1894
1895         However, in the case where we're synthesizing a mouse event for a "dblclick" event handler (after a double-
1896         tap), we currently pass `NoTap` as the synthetic click event type when creating the mouse event. This causes
1897         additional pointer events to be synthesized and dispatched during a double tap, which creates three pairs of
1898         "pointerdown"/"pointerup" events upon double-tap. This subsequently confuses iCloud Notes' web app when double
1899         tapping to select a word.
1900
1901         Fix this by passing in `OneFingerTap` as the synthetic click type instead (since two-finger double taps should
1902         already be handled by the two-finger double-tap magnification gesture).
1903
1904         Test: pointerevents/ios/pointer-events-for-double-tap.html
1905
1906         * WebProcess/WebPage/ios/WebPageIOS.mm:
1907         (WebKit::WebPage::handleDoubleTapForDoubleClickAtPoint):
1908
1909 2020-02-01  Darin Adler  <darin@apple.com>
1910
1911         Replace RGBA32 typedef with a class to improve type safety
1912         https://bugs.webkit.org/show_bug.cgi?id=206862
1913
1914         Reviewed by Sam Weinig.
1915
1916         * Shared/WebCoreArgumentCoders.cpp:
1917         (IPC::ArgumentCoder<Color>::encode): Use uint32_t explicitly to convert
1918         the color value into a SimpleColor.
1919         (IPC::ArgumentCoder<Color>::decode): Same thing, only the other direction.
1920
1921 2020-02-04  Darin Adler  <darin@apple.com>
1922
1923         Remove NSKeyedArchiverSPI.h now that WebKit only uses API
1924         https://bugs.webkit.org/show_bug.cgi?id=207203
1925
1926         Reviewed by Anders Carlsson.
1927
1928         * Platform/ios/AccessibilityIOS.mm:
1929         (WebKit::newAccessibilityRemoteToken): Removed include of NSKeyedArchiverSPI.h;
1930         use NSKeyedArchiver methods directly.
1931         * Shared/Cocoa/ArgumentCodersCocoa.mm:
1932         (IPC::encodeSecureCodingInternal): Ditto.
1933         (IPC::decodeSecureCodingInternal): Ditto.
1934
1935         * Shared/Cocoa/DataDetectionResult.mm: Removed include of NSKeyedArchiverSPI.h.
1936         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: Ditto.
1937         * Shared/ios/InteractionInformationAtPosition.mm: Ditto.
1938
1939         * Shared/mac/WebCoreArgumentCodersMac.mm:
1940         (IPC::ArgumentCoder<WebCore::ContentFilterUnblockHandler>::encode): Removed
1941         include of NSKeyedArchiverSPI.h; use NSKeyedArchiver methods directly.
1942         (IPC::ArgumentCoder<WebCore::ContentFilterUnblockHandler>::decode): Ditto.
1943
1944         * Shared/mac/WebHitTestResultData.mm: Removed include of NSKeyedArchiverSPI.h.
1945
1946         * UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
1947         (API::Attachment::createSerializedRepresentation const): Removed
1948         include of NSKeyedArchiverSPI.h; use NSKeyedArchiver methods directly. Also
1949         refactored so the !CAN_SECURELY_ARCHIVE_FILE_WRAPPER path shares more code
1950         with the modern code path. I think we can remove it entirely once we bump
1951         the minimum version of macOS a bit more.
1952         (API::Attachment::updateFromSerializedRepresentation): Ditto.
1953         * UIProcess/API/Cocoa/WKProcessPool.mm:
1954         (-[WKProcessPool _setObject:forBundleParameter:]): Ditto.
1955         (-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]): Ditto.
1956         * UIProcess/API/Cocoa/WKWebView.mm:
1957         (-[WKWebView initWithCoder:]): Ditto.
1958         (-[WKWebView _setInputDelegate:]): Ditto.
1959         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1960         (-[WKWebViewConfiguration initWithCoder:]): Ditto.
1961         * UIProcess/API/Cocoa/_WKApplicationManifest.mm:
1962         (-[_WKApplicationManifest initWithCoder:]): Ditto.
1963         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1964         (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
1965         * UIProcess/ios/PageClientImplIOS.mm:
1966         (WebKit::PageClientImpl::elementDidFocus): Ditto.
1967         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1968         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Ditto.
1969         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm: Removed include of NSKeyedArchiverSPI.h
1970         (WebKit::createUnarchiver): Added helper function to make the code below less repetitive.
1971         (WebKit::InjectedBundle::initialize): Use the createUnarchiver function above and the
1972         NSKeyedArchiver methods directly.
1973         (WebKit::InjectedBundle::classesForCoder): Ditto.
1974         (WebKit::InjectedBundle::setBundleParameter): Ditto.
1975         (WebKit::InjectedBundle::setBundleParameters): Ditto.
1976
1977 2020-02-04  Tim Horton  <timothy_horton@apple.com>
1978
1979         macCatalyst: Shouldn't get text cursor on checkboxes
1980         https://bugs.webkit.org/show_bug.cgi?id=207234
1981         <rdar://problem/59155917>
1982
1983         Reviewed by Wenson Hsieh.
1984
1985         * WebProcess/WebPage/ios/WebPageIOS.mm:
1986         (WebKit::canForceCaretForPosition):
1987         (WebKit::populateCaretContext):
1988         (WebKit::lineCaretExtent): Deleted.
1989         The I-beam forcing code was a bit too aggressive; it should consider
1990         the style of the node that it ends up finding after searching, not just
1991         assume it wants an I-beam because it's "texty".
1992
1993 2020-02-04  Alex Christensen  <achristensen@webkit.org>
1994
1995         Fix Mac CMake build
1996         https://bugs.webkit.org/show_bug.cgi?id=207231
1997
1998         * PlatformMac.cmake:
1999         * WebProcess/WebPage/mac/WebPageMac.mm:
2000         (WebKit::WebPage::updateVisibleContentRects):
2001
2002 2020-02-04  Chris Dumez  <cdumez@apple.com>
2003
2004         Partial revert of r248734 to fix leak of StorageAreaMaps
2005         https://bugs.webkit.org/show_bug.cgi?id=207073
2006
2007         Reviewed by Alex Christensen.
2008
2009         Do a partial revert of r248734 so that the StorageNamespaceImpl no longer holds a strong
2010         reference to its StorageAreaMap objects. The code for removing entries from 
2011         StorageNamespaceImpl::m_storageAreaMaps (StorageNamespaceImpl::didDestroyStorageAreaMap())
2012         was dead code after r248734 and thus StorageAreaMap were never destroyed.
2013
2014         * WebProcess/WebStorage/StorageAreaImpl.cpp:
2015         (WebKit::StorageAreaImpl::create):
2016         (WebKit::StorageAreaImpl::StorageAreaImpl):
2017         (WebKit::StorageAreaImpl::length):
2018         (WebKit::StorageAreaImpl::key):
2019         (WebKit::StorageAreaImpl::item):
2020         (WebKit::StorageAreaImpl::setItem):
2021         (WebKit::StorageAreaImpl::removeItem):
2022         (WebKit::StorageAreaImpl::clear):
2023         (WebKit::StorageAreaImpl::contains):
2024         (WebKit::StorageAreaImpl::storageType const):
2025         * WebProcess/WebStorage/StorageAreaImpl.h:
2026         * WebProcess/WebStorage/StorageAreaMap.cpp:
2027         (WebKit::StorageAreaMap::create):
2028         (WebKit::StorageAreaMap::~StorageAreaMap):
2029         * WebProcess/WebStorage/StorageAreaMap.h:
2030         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
2031         (WebKit::StorageNamespaceImpl::storageArea):
2032         * WebProcess/WebStorage/StorageNamespaceImpl.h:
2033
2034 2020-02-04  Chris Dumez  <cdumez@apple.com>
2035
2036         Unreviewed, follow-up assertion fix after r255662.
2037
2038         * UIProcess/WebProcessPool.cpp:
2039         (WebKit::WebProcessPool::initializeNewWebProcess):
2040
2041 2020-02-04  Wenson Hsieh  <wenson_hsieh@apple.com>
2042
2043         [macCatalyst] Missing custom cursors in subframes that are offset from the origin of the root view
2044         https://bugs.webkit.org/show_bug.cgi?id=207215
2045         <rdar://problem/59157625>
2046
2047         Reviewed by Tim Horton.
2048
2049         <https://trac.webkit.org/r255046> added support for custom cursor styles when hovering over subframes. However,
2050         we currently try to hit-test content in the subframe using the interaction information request's point, which is
2051         in root view coordinates; as such, we only get the correct custom cursor styles when hovering over elements in a
2052         subframe, if the subframe is also at the origin of the root view.
2053
2054         To fix this, simply convert from root view coordinates to frame coordinates when performing the hit-test.
2055         Unfortunately, this change is currently untestable; see <rdar://problem/59158410>.
2056
2057         * WebProcess/WebPage/ios/WebPageIOS.mm:
2058         (WebKit::lineCaretExtent):
2059
2060 2020-02-04  Megan Gardner  <megan_gardner@apple.com>
2061
2062         Fixed Deprecated API
2063         https://bugs.webkit.org/show_bug.cgi?id=207179
2064
2065         Reviewed by Tim Horton.
2066
2067         Fixing deprecated API for MacCatalyst.
2068
2069         No new tests - build fix.
2070
2071         * Shared/UserInterfaceIdiom.mm:
2072         (WebKit::userInterfaceIdiomIsPad):
2073
2074 2020-02-04  Don Olmstead  <don.olmstead@sony.com>
2075
2076         [PlayStation] Add WebKit API files
2077         https://bugs.webkit.org/show_bug.cgi?id=207168
2078
2079         Reviewed by Darin Adler.
2080
2081         Add PlayStation WebKit API files and expose them in the root header. Fix up the
2082         build to copy them over. Also make sure that the playstation directory is listed
2083         as a platform in the forwarding headers script.
2084
2085         * PlatformPlayStation.cmake:
2086         * Scripts/generate-forwarding-headers.pl:
2087         * Shared/API/c/WKBase.h:
2088         * Shared/API/c/playstation/WKBasePlayStation.h: Added.
2089         * UIProcess/API/C/WKAPICast.h:
2090         * UIProcess/API/C/playstation/WKAPICastPlayStation.h: Added.
2091         * UIProcess/API/C/playstation/WKView.h: Added.
2092
2093 2020-02-04  youenn fablet  <youenn@apple.com>
2094
2095         NetworkProcess should be notified by UIProcess when its service worker process connection should be on
2096         https://bugs.webkit.org/show_bug.cgi?id=207122
2097         <rdar://problem/59089780>
2098
2099         Reviewed by Chris Dumez.
2100
2101         Add completion handlers to the messaging from NetworkProcess -> UIProcess -> WebProcess -> NetworkProcess
2102         used to create a service worker context connection.
2103
2104         This allows NetworkProcess to ask again for a connection if the connection is still needed but NetworkProcess did not find the context connection.
2105
2106         This is difficult to test since we would need for the process selected to host service workers to exit between the
2107         time it is selected and the time it sends the message to Networking process.
2108
2109         To ensure that the context connection is created by WebProcess, WebProcessProxy takes a background assertion until WebProcess finishes
2110         creating the context connection to Network process.
2111
2112         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2113         (WebKit::NetworkConnectionToWebProcess::establishSWContextConnection):
2114         * NetworkProcess/NetworkConnectionToWebProcess.h:
2115         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2116         * NetworkProcess/NetworkProcess.cpp:
2117         (WebKit::NetworkProcess::swServerForSession):
2118         * NetworkProcess/NetworkProcess.h:
2119         * UIProcess/Network/NetworkProcessProxy.cpp:
2120         (WebKit::NetworkProcessProxy::establishWorkerContextConnectionToNetworkProcess):
2121         * UIProcess/Network/NetworkProcessProxy.h:
2122         * UIProcess/Network/NetworkProcessProxy.messages.in:
2123         * UIProcess/WebProcessPool.cpp:
2124         (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
2125         * UIProcess/WebProcessPool.h:
2126         * UIProcess/WebProcessProxy.cpp:
2127         (WebKit::WebProcessProxy::establishServiceWorkerContext):
2128         * UIProcess/WebProcessProxy.h:
2129         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2130         (WebKit::m_userAgent):
2131         (WebKit::WebSWContextManagerConnection::establishConnection):
2132         * WebProcess/Storage/WebSWContextManagerConnection.h:
2133         * WebProcess/WebProcess.cpp:
2134         (WebKit::WebProcess::establishWorkerContextConnectionToNetworkProcess):
2135         * WebProcess/WebProcess.h:
2136         * WebProcess/WebProcess.messages.in:
2137
2138 2020-02-04  Chris Dumez  <cdumez@apple.com>
2139
2140         Unreviewed, follow-up assertion fix after r255662.
2141
2142         * UIProcess/WebProcessPool.cpp:
2143         (WebKit::WebProcessPool::initializeNewWebProcess):
2144
2145 2020-02-04  Carlos Garcia Campos  <cgarcia@igalia.com>
2146
2147         REGRESSION(r255595): page not closed after beforeunload handler returns true
2148         https://bugs.webkit.org/show_bug.cgi?id=207189
2149
2150         Reviewed by Chris Dumez.
2151
2152         We are assuming the try close did timeout in that case, because the timer is stopped before running the
2153         beforeunload dialog.
2154
2155         * UIProcess/WebPageProxy.cpp:
2156         (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel): Start the try close timer again when the beforeunload
2157         dialog replies.
2158
2159 2020-02-04  Ross Kirsling  <ross.kirsling@sony.com>
2160
2161         [CMake] Add Cairo::Cairo target
2162         https://bugs.webkit.org/show_bug.cgi?id=207159
2163
2164         Reviewed by Konstantin Tokarev.
2165
2166         * PlatformGTK.cmake:
2167         * PlatformWPE.cmake:
2168         * PlatformWin.cmake:
2169
2170 2020-02-04  Fujii Hironori  <Hironori.Fujii@sony.com>
2171
2172         [Win][Clang] WebProcessMain.h(28,14): error: token is not a valid binary operator in a preprocessor subexpression
2173         https://bugs.webkit.org/show_bug.cgi?id=207188
2174
2175         Unreviewed build fix for WinCairo port.
2176
2177         * NetworkProcess/EntryPoint/win/NetworkProcessMain.cpp:
2178         * WebProcess/EntryPoint/win/WebProcessMain.cpp:
2179         Added #include "config.h".
2180
2181 2020-02-03  Wenson Hsieh  <wenson_hsieh@apple.com>
2182
2183         Add a WebKitAdditions hook to provide additional customizations to UIDragInteraction
2184         https://bugs.webkit.org/show_bug.cgi?id=207177
2185         <rdar://problem/59121266>
2186
2187         Reviewed by Tim Horton.
2188
2189         Add a WebKitAdditions extension point that runs immediately after setting up UIDragInteraction and
2190         UIDropInteraction.
2191
2192         * UIProcess/ios/WKContentViewInteraction.mm:
2193         (-[WKContentView setupDragAndDropInteractions]):
2194
2195 2020-02-03  Chris Dumez  <cdumez@apple.com>
2196
2197         Stop relying on ResponsivenessTimer to keep the WebProcess from suspending during initialization
2198         https://bugs.webkit.org/show_bug.cgi?id=207144
2199
2200         Reviewed by Brady Eidson.
2201
2202         Stop relying on ResponsivenessTimer to keep the WebProcess from suspending during initialization. Instead, make the
2203         WebProcess::InitializeWebProcess IPC async with a reply and take a process assertion on behalf of the WebContent
2204         process until we get a response back.
2205
2206         This avoids sending an extra WebProcess::MainThreadPing IPC to the WebProcess for no reason (since we're already
2207         sending the WebProcess::InitializeWebProcess IPC) and this is also more reliable since the ResponsivenessTimer can
2208         actually time out and cause the process to get suspended during initialization still.
2209
2210         * UIProcess/WebProcessPool.cpp:
2211         (WebKit::WebProcessPool::initializeNewWebProcess):
2212         * WebProcess/WebProcess.cpp:
2213         (WebKit::WebProcess::initializeWebProcess):
2214         * WebProcess/WebProcess.h:
2215         * WebProcess/WebProcess.messages.in:
2216
2217 2020-02-03  Jiewen Tan  <jiewen_tan@apple.com>
2218
2219         Pass a hint from the extension to decidePolicyForSOAuthorizationLoadWithCurrentPolicy
2220         https://bugs.webkit.org/show_bug.cgi?id=207079
2221         <rdar://problem/48290464>
2222
2223         Reviewed by Brent Fulgham.
2224
2225         Pass a localized human readable hint from the extension to decidePolicyForSOAuthorizationLoadWithCurrentPolicy,
2226         such that clients can display it to tell users what the extension is trying to do. Hints could be something
2227         like "Sign In With Apple".
2228
2229         Covered new test contents within existing tests.
2230
2231         * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.h:
2232         * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm:
2233         (WebKit::SOAuthorizationSession::start):
2234         (WebKit::SOAuthorizationSession::continueStartAfterGetAuthorizationHints):
2235         (WebKit::SOAuthorizationSession::continueStartAfterDecidePolicy):
2236
2237 2020-02-03  Wenson Hsieh  <wenson_hsieh@apple.com>
2238
2239         Unreviewed, fix the internal build after <rdar://problem/59132944>
2240
2241         * UIProcess/ios/WKContentViewInteraction.h: Declare this helper in the header, now that it's consulted by some
2242         WebKitAdditions code.
2243
2244 2020-02-03  Wenson Hsieh  <wenson_hsieh@apple.com>
2245
2246         Add a WebKitAdditions hook to override the behavior of -[WKContentView gestureRecognizer:shouldReceiveTouch:]
2247         https://bugs.webkit.org/show_bug.cgi?id=207162
2248         <rdar://problem/59129739>
2249
2250         Reviewed by Tim Horton.
2251
2252         Allow an internal implementation of `-_allowGestureRecognizer:toReceiveTouch:` to prevent touches from being
2253         routed to certain gesture recognizers, if necessary.
2254
2255         * UIProcess/ios/WKContentViewInteraction.mm:
2256         (-[WKContentView gestureRecognizer:shouldReceiveTouch:]):
2257
2258 2020-02-03  Chris Dumez  <cdumez@apple.com>
2259
2260         [WK2] Use per-UIProcess default cookie storage for Mac Catalyst apps
2261         https://bugs.webkit.org/show_bug.cgi?id=207139
2262         <rdar://problem/59047014>
2263
2264         Reviewed by Brent Fulgham.
2265
2266         Use per-UIProcess default cookie storage for Mac Catalyst apps, similarly to what
2267         we do for regular macOS apps.
2268
2269         * NetworkProcess/NetworkProcess.h:
2270         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2271         (WebKit::NetworkProcessCreationParameters::encode const):
2272         (WebKit::NetworkProcessCreationParameters::decode):
2273         * NetworkProcess/NetworkProcessCreationParameters.h:
2274         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2275         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2276         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2277         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2278
2279 2020-02-03  Wenson Hsieh  <wenson_hsieh@apple.com>
2280
2281         [iOS 13] Dragging on-screen volume control on a YouTube video selects text around the panel
2282         https://bugs.webkit.org/show_bug.cgi?id=207140
2283         <rdar://problem/58852938>
2284
2285         Reviewed by Tim Horton.
2286
2287         This bug occurs on iPadOS when long pressing the volume controls on the desktop version of YouTube, and then
2288         performing a pan gesture; this activates the highlight text selection gesture recognizer added in iOS 13,
2289         causing text to be selected while adjusting the volume using these custom controls. On macOS, we avoid this
2290         because `Node::canStartSelection()` returns `false`, due to a container node having both `user-drag: element`
2291         and `user-select: none`; in this scenario, we allow dragging to take precendence over text selection, so the
2292         volume slider can be moved using a mouse without simultaneously selecting text.
2293
2294         This logic is currently absent on iOS, where UIKit text interaction gesture recognizers ask us for information
2295         about the DOM at given locations, and we determine whether to allow text interaction gestures (such as long
2296         pressing) to begin in `-textInteractionGesture:shouldBeginAtPoint:` and `-hasSelectablePositionAtPoint:`.
2297         Ideally, we'd want to eventually unify these two codepaths for triggering text selection (and preferably just
2298         have both go through EventHandler); in lieu of this, simply make the iOS codepath behave a little more like
2299         macOS by adding a bit to allow text interaction gestures to bail in the case where at least one container of the
2300         hit-tested element is both draggable and unselectable.
2301
2302         Test: editing/selection/ios/prefer-drag-over-text-selection.html
2303
2304         * Shared/ios/InteractionInformationAtPosition.h:
2305         * Shared/ios/InteractionInformationAtPosition.mm:
2306         (WebKit::InteractionInformationAtPosition::encode const):
2307         (WebKit::InteractionInformationAtPosition::decode):
2308
2309         Add the new bit to InteractionInformationAtPosition.
2310
2311         * UIProcess/ios/WKContentViewInteraction.mm:
2312         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
2313
2314         Avoid beginning text selection if the bit is set.
2315
2316         * WebProcess/WebPage/ios/WebPageIOS.mm:
2317         (WebKit::selectionPositionInformation):
2318
2319         Move a comment about the ">= 97% of the document's visible area" heuristic next to the relevant code, and also
2320         leave a FIXME mentioning that we should reconsider whether this is really needed; it seems that this was
2321         originally intended to avoid ending up with an excessively large block selection, but block selection has been
2322         removed entirely since iOS 12. That said, this logic may still be helping avoid situations where the text
2323         selection is too aggressive on iOS and ends up selecting too much text.
2324
2325 2020-02-03  Chris Dumez  <cdumez@apple.com>
2326
2327         Regression(r253224) WKUIDelegate.webViewDidClose may get called twice after calling _tryClose on the WKWebView
2328         https://bugs.webkit.org/show_bug.cgi?id=207121
2329         <rdar://problem/58880177>
2330
2331         Reviewed by Alex Christensen.
2332
2333         WKUIDelegate.webViewDidClose may get called twice after calling _tryClose on the WKWebView, in case we time out
2334         while waiting for an answer from the WebProcess but the WebProcess eventually responds.
2335
2336         Change is covered by new API test.
2337
2338         * UIProcess/WebPageProxy.cpp:
2339         (WebKit::WebPageProxy::tryClose):
2340
2341 2020-02-03  Eric Carlson  <eric.carlson@apple.com>
2342
2343         [macOS] AirPlay sometimes stops after 60 minutes of playback
2344         https://bugs.webkit.org/show_bug.cgi?id=207056
2345
2346         Reviewed by Jer Noble.
2347
2348         * UIProcess/WebPageProxy.cpp:
2349         * UIProcess/WebPageProxy.h:
2350
2351 2020-02-03  Sam Weinig  <weinig@apple.com>
2352
2353         Start splitting platform specific overrides of default enable behavior into their own files
2354         https://bugs.webkit.org/show_bug.cgi?id=207105
2355
2356         Reviewed by Dean Jackson.
2357
2358         * WebProcess/WebProcess.cpp:
2359         (WebKit::WebProcess::shouldPlugInAutoStartFromOrigin):
2360         Switch to using the ENABLE() helper macro to correctly guard against the case that
2361         ENABLE_PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC is defined and equal to 0.
2362
2363 2020-02-03  Keith Rollin  <krollin@apple.com>
2364
2365         Unreviewed watchOS build fix after r255559- add missing semi-colon.
2366
2367         * UIProcess/ios/forms/WKFocusedFormControlView.mm:
2368         (-[WKFocusedFormControlView scrollOffsetForCrownInputOffset:]):
2369
2370 2020-02-03  Zan Dobersek  <zdobersek@igalia.com>
2371
2372         Use std::hypot() where possible
2373         https://bugs.webkit.org/show_bug.cgi?id=198483
2374
2375         Reviewed by Carlos Garcia Campos.
2376
2377         Use std::hypot() where possible, allowing for a possibly more precise
2378         calculation of square roots of sums of two or three square values.
2379
2380         * Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
2381         (WebKit::vectorLength):
2382         * UIProcess/ios/forms/WKFocusedFormControlView.mm:
2383         (-[WKFocusedFormControlView scrollOffsetForCrownInputOffset:]):
2384
2385 2020-02-01  Michael Catanzaro  <mcatanzaro@gnome.org>
2386
2387         Silence compiler warnings
2388         https://bugs.webkit.org/show_bug.cgi?id=207015
2389
2390         Reviewed by Darin Adler.
2391
2392         Use UNUSED_VARIABLE() for variable that is only used inside RELEASE_LOG(), which is
2393         Apple-specific.
2394
2395         * NetworkProcess/NetworkResourceLoader.cpp:
2396         (WebKit::NetworkResourceLoader::didFailLoading):
2397
2398 2020-02-01  Devin Rousso  <drousso@apple.com>
2399
2400         Web Inspector: move the items in the toolbar into the tab bar to save vertical space
2401         https://bugs.webkit.org/show_bug.cgi?id=204627
2402
2403         Reviewed by Timothy Hatcher.
2404
2405         Now that there is no toolbar area, there is nothing obstructing the ability for the window
2406         to be moved around when dragging via the title bar area. As such, we can remove the unused
2407         `InspectorFrontendHost` APIs.
2408
2409         * WebProcess/Inspector/WebInspectorUI.h:
2410         * WebProcess/Inspector/WebInspectorUI.cpp:
2411         (WebKit::WebInspectorUI::startWindowDrag): Deleted.
2412         (WebKit::WebInspectorUI::moveWindowBy): Deleted.
2413         * UIProcess/Inspector/WebInspectorProxy.messages.in:
2414         * UIProcess/Inspector/WebInspectorProxy.h:
2415         * UIProcess/Inspector/WebInspectorProxy.cpp:
2416         (WebKit::WebInspectorProxy::startWindowDrag): Deleted.
2417         (WebKit::WebInspectorProxy::platformStartWindowDrag): Deleted.
2418         * UIProcess/Inspector/gtk/WebInspectorProxyGtk.cpp:
2419         (WebKit::WebInspectorProxy::platformStartWindowDrag): Deleted.
2420         * UIProcess/Inspector/mac/WebInspectorProxyMac.mm:
2421         (WebKit::WebInspectorProxy::platformStartWindowDrag): Deleted.
2422         * UIProcess/Inspector/win/WebInspectorProxyWin.cpp:
2423         (WebKit::WebInspectorProxy::platformStartWindowDrag): Deleted.
2424         * UIProcess/Inspector/wpe/WebInspectorProxyWPE.cpp:
2425         (WebKit::WebInspectorProxy::platformStartWindowDrag): Deleted.
2426
2427         * WebProcess/Inspector/RemoteWebInspectorUI.h:
2428         * WebProcess/Inspector/RemoteWebInspectorUI.cpp:
2429         (WebKit::RemoteWebInspectorUI::startWindowDrag): Deleted.
2430         (WebKit::RemoteWebInspectorUI::moveWindowBy): Deleted.
2431         * UIProcess/Inspector/RemoteWebInspectorProxy.messages.in:
2432         * UIProcess/Inspector/RemoteWebInspectorProxy.cpp:
2433         * UIProcess/Inspector/RemoteWebInspectorProxy.h:
2434         (WebKit::RemoteWebInspectorProxy::startWindowDrag): Deleted.
2435         (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag): Deleted.
2436         * UIProcess/Inspector/gtk/RemoteWebInspectorProxyGtk.cpp:
2437         (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag): Deleted.
2438         * UIProcess/Inspector/mac/RemoteWebInspectorProxyMac.mm:
2439         (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag): Deleted.
2440         * UIProcess/Inspector/win/RemoteWebInspectorProxyWin.cpp:
2441         (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag): Deleted.
2442
2443 2020-01-31  David Quesada  <david_quesada@apple.com>
2444
2445         REGRESSION(r252185): NetworkSessionCocoa cancels downloads that receive authentication challenges
2446         https://bugs.webkit.org/show_bug.cgi?id=206984
2447         rdar://problem/58999654
2448
2449         Reviewed by Brady Eidson.
2450
2451         r252185 changed the early return in WKNetworkSessionDelegate's -...task:didReceiveChallenge:... method
2452         from "cancel the task and return early if self has no _session" to "cancel the task and return early
2453         if we can't determine the network session for the given data task". When this method is called for
2454         an NSURLSessionDownloadTask, this early return is hit because there is no NetworkDataTaskCocoa
2455         for an active download. As a result, the download is canceled when it might have otherwise been able
2456         to proceed.
2457
2458         Fix this by adding a code path to fetch the NetworkSession associated with the Download when an
2459         NSURLSessionDownloadTask receives an authentication challenge. This ensures we can actually handle
2460         the challenge appropriately and not just cancel the task.
2461
2462         * NetworkProcess/Downloads/Download.h:
2463         (WebKit::Download::sessionID const):
2464             Expose the session ID so we can use it to look up the NetworkSession for a Download.
2465         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2466         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
2467             Remove an unnecessary redeclaration of networkDataTask, and also an unneeded assertion that
2468             networkDataTask != nullptr. Even if this is the case, the code that eventually handles this
2469             task will null check it and handle the challenge as a websocket task or download task
2470             based on the taskIdentifier.
2471
2472 2020-01-31  Wenson Hsieh  <wenson_hsieh@apple.com>
2473
2474         Add support for specifying background colors when setting marked text
2475         https://bugs.webkit.org/show_bug.cgi?id=207065
2476         <rdar://problem/57876140>
2477
2478         Reviewed by Tim Horton.
2479
2480         Implement -setAttributedMarkedText:selectedRange: on WKContentView, and have it extract highlight color
2481         information from the given attributed string. Plumb this through to the web process by serializing and
2482         deserializing `WebCore::CompositionHighlight`s.
2483
2484         * UIProcess/Cocoa/WebViewImpl.mm:
2485         (WebKit::WebViewImpl::setMarkedText):
2486         * UIProcess/WebPageProxy.cpp:
2487         * UIProcess/WebPageProxy.h:
2488         * UIProcess/ios/WKContentViewInteraction.mm:
2489         (compositionHighlights):
2490
2491         For each marked text clause, grab the specified background color (defaulting to Color::compositionFill) and use
2492         it to create a list of CompositionHighlights.
2493
2494         (-[WKContentView setAttributedMarkedText:selectedRange:]):
2495         (-[WKContentView setMarkedText:selectedRange:]):
2496         (-[WKContentView _setMarkedText:highlights:selectedRange:]):
2497         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2498         (WKBundlePageSetComposition):
2499
2500         Add testing support for specifying highlight ranges when setting marked text.
2501
2502         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
2503         * WebProcess/WebCoreSupport/glib/WebEditorClientGLib.cpp:
2504         (WebKit::WebEditorClient::didDispatchInputMethodKeydown):
2505         * WebProcess/WebPage/WebPage.cpp:
2506         (WebKit::WebPage::setCompositionForTesting):
2507         (WebKit::WebPage::setCompositionAsync):
2508         * WebProcess/WebPage/WebPage.h:
2509         * WebProcess/WebPage/WebPage.messages.in:
2510
2511 2020-01-31  Andy Estes  <aestes@apple.com>
2512
2513         Unreviewed build fix after r255522.
2514
2515         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2516         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
2517         Switched to a C-style cast.
2518
2519 2020-01-31  Alex Christensen  <achristensen@webkit.org>
2520
2521         Add KVO SPI WKWebView._negotiatedLegacyTLS
2522         https://bugs.webkit.org/show_bug.cgi?id=207067
2523
2524         Reviewed by Andy Estes.
2525
2526         Covered by API tests.
2527
2528         * NetworkProcess/NetworkDataTask.cpp:
2529         (WebKit::NetworkDataTask::negotiatedLegacyTLS const):
2530         * NetworkProcess/NetworkDataTask.h:
2531         (WebKit::NetworkDataTaskClient::negotiatedLegacyTLS const):
2532         * NetworkProcess/NetworkLoad.cpp:
2533         (WebKit::NetworkLoad::negotiatedLegacyTLS const):
2534         * NetworkProcess/NetworkLoad.h:
2535         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2536         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
2537         * Shared/Authentication/AuthenticationManager.cpp:
2538         (WebKit::AuthenticationManager::negotiatedLegacyTLS const):
2539         * Shared/Authentication/AuthenticationManager.h:
2540         * UIProcess/API/Cocoa/WKWebView.mm:
2541         (-[WKWebView _negotiatedLegacyTLS]):
2542         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2543         * UIProcess/Cocoa/NavigationState.h:
2544         * UIProcess/Cocoa/NavigationState.mm:
2545         (WebKit::NavigationState::willChangeNegotiatedLegacyTLS):
2546         (WebKit::NavigationState::didChangeNegotiatedLegacyTLS):
2547         * UIProcess/Network/NetworkProcessProxy.cpp:
2548         (WebKit::NetworkProcessProxy::negotiatedLegacyTLS):
2549         * UIProcess/Network/NetworkProcessProxy.h:
2550         * UIProcess/Network/NetworkProcessProxy.messages.in:
2551         * UIProcess/PageLoadState.cpp:
2552         (WebKit::PageLoadState::commitChanges):
2553         (WebKit::PageLoadState::hasNegotiatedLegacyTLS const):
2554         (WebKit::PageLoadState::negotiatedLegacyTLS):
2555         (WebKit::PageLoadState::didCommitLoad):
2556         * UIProcess/PageLoadState.h:
2557         (WebKit::PageLoadState::Observer::willChangeNegotiatedLegacyTLS):
2558         (WebKit::PageLoadState::Observer::didChangeNegotiatedLegacyTLS):
2559         (WebKit::PageLoadState::Data::Data): Deleted.
2560         * UIProcess/WebPageProxy.cpp:
2561         * UIProcess/WebPageProxy.h:
2562
2563 2020-01-31  Chris Dumez  <cdumez@apple.com>
2564
2565         Unreviewed macOS build fix after r255518
2566
2567         * UIProcess/WebPageProxy.cpp:
2568         (WebKit::WebPageProxy::handleGestureEvent):
2569
2570 2020-01-31  Chris Dumez  <cdumez@apple.com>
2571
2572         [ iOS ] imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes-cursors.any.serviceworker.html is flaky failing.
2573         https://bugs.webkit.org/show_bug.cgi?id=206934
2574         <rdar://problem/58991581>
2575
2576         Reviewed by Brady Eidson.
2577
2578         Flakiness would happen when the service worker would take too long to launch and the responsiveness timer would fire and
2579         report the process as unresponsive while still launching or very shortly after. When a service worker is reported as
2580         unresponsive, we would kill it.
2581
2582         To address the issue, several changes were made:
2583         - Responsiveness checks are now disabled for slow builds (Debug, ASAN, GuardMalloc)
2584         - We only start the ResponsivenessTimer after the process has finished launching since the responsiveness
2585           check relies on IPC to the process and we cannot send the IPC until after the process has launched.
2586
2587         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
2588         (WebKit::DrawingAreaProxyCoordinatedGraphics::sendUpdateBackingStoreState):
2589         * UIProcess/ProvisionalPageProxy.cpp:
2590         (WebKit::ProvisionalPageProxy::goToBackForwardItem):
2591         * UIProcess/WebPageProxy.cpp:
2592         (WebKit::WebPageProxy::launchProcessForReload):
2593         (WebKit::WebPageProxy::launchProcessWithItem):
2594         (WebKit::WebPageProxy::loadRequestWithNavigationShared):
2595         (WebKit::WebPageProxy::loadFile):
2596         (WebKit::WebPageProxy::loadDataWithNavigationShared):
2597         (WebKit::WebPageProxy::loadAlternateHTML):
2598         (WebKit::WebPageProxy::loadWebArchiveData):
2599         (WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick):
2600         (WebKit::WebPageProxy::stopLoading):
2601         (WebKit::WebPageProxy::reload):
2602         (WebKit::WebPageProxy::goToBackForwardItem):
2603         (WebKit::WebPageProxy::dispatchActivityStateChange):
2604         (WebKit::WebPageProxy::processNextQueuedMouseEvent):
2605         (WebKit::WebPageProxy::handleKeyboardEvent):
2606         (WebKit::WebPageProxy::handleGestureEvent):
2607         (WebKit::WebPageProxy::handlePreventableTouchEvent):
2608         (WebKit::WebPageProxy::handleTouchEvent):
2609         (WebKit::WebPageProxy::runJavaScriptAlert):
2610         (WebKit::WebPageProxy::runJavaScriptConfirm):
2611         (WebKit::WebPageProxy::runJavaScriptPrompt):
2612         (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
2613         (WebKit::WebPageProxy::runOpenPanel):
2614         * UIProcess/WebProcessProxy.cpp:
2615         (WebKit::WebProcessProxy::mayBecomeUnresponsive):
2616         (WebKit::WebProcessProxy::didFinishLaunching):
2617         (WebKit::WebProcessProxy::startResponsivenessTimer):
2618         (WebKit::WebProcessProxy::isResponsive):
2619         * UIProcess/WebProcessProxy.h:
2620         (WebKit::WebProcessProxy::responsivenessTimer):
2621
2622 2020-01-31  Kate Cheney  <katherine_cheney@apple.com>
2623
2624         Add page configuration additions to APIPageConfiguration
2625         https://bugs.webkit.org/show_bug.cgi?id=206090
2626         <rdar://problem/58489766>
2627
2628         Reviewed by Andy Estes.
2629
2630         * UIProcess/API/APIPageConfiguration.cpp:
2631
2632 2020-01-31  David Kilzer  <ddkilzer@apple.com>
2633
2634         REGRESSION: [ iPadOS ] imported/w3c/web-platform-tests/dom/events/Event-dispatch-on-disabled-elements.html always fails
2635         <https://webkit.org/b/206759>
2636         <rdar://problem/58872607>
2637
2638         Reviewed by Brent Fulgham.
2639
2640         Test: imported/w3c/web-platform-tests/dom/events/Event-dispatch-on-disabled-elements.html
2641
2642         * Platform/spi/ios/UIKitSPI.h:
2643         (-[UIViewController isPerformingModalTransition]): Add SPI
2644         declaration.
2645
2646 2020-01-31  Brent Fulgham  <bfulgham@apple.com>
2647
2648         REGRESSION (r251511): [iOS] HDR Playback broken
2649         https://bugs.webkit.org/show_bug.cgi?id=207052
2650         <rdar://problem/58975614>
2651
2652         Reviewed by Maciej Stachowiak.
2653
2654         I missed an XPC service in Bug 203318 when I stopped importing the 'common.sb' sandbox. This broke some
2655         aspects of HDR playback for certain clients.
2656
2657         This patch returns the XPC service, and unblocks access to a network preference file that AVFoundation
2658         needs to read to support some media playback features.
2659
2660         * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb:
2661         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2662
2663 2020-01-31  Alejandro G. Castro  <alex@igalia.com>
2664
2665         Compilation broken without service workers
2666         https://bugs.webkit.org/show_bug.cgi?id=207037
2667
2668         Reviewed by Chris Dumez.
2669
2670         Protect the use of m_swServers, check if the SERVICE_WORKER is
2671         enabled.
2672
2673         * NetworkProcess/NetworkProcess.cpp:
2674         (WebKit::NetworkProcess::lowMemoryHandler):
2675
2676 2020-01-31  David Quesada  <david_quesada@apple.com>
2677
2678         Remove unused WKProcessPool downloads SPI
2679         https://bugs.webkit.org/show_bug.cgi?id=207029
2680         rdar://problem/59052066
2681
2682         Reviewed by Anders Carlsson.
2683
2684         Remove two unused SPI for starting/resuming downloads from a process pool. These methods were
2685         deprecated in favor of variants that also require a WKWebsiteDataStore, and all clients of these
2686         methods have switched to the new versions.
2687
2688         * UIProcess/API/Cocoa/WKProcessPool.mm:
2689         (-[WKProcessPool _downloadURLRequest:originatingWebView:]): Deleted.
2690         (-[WKProcessPool _resumeDownloadFromData:path:originatingWebView:]): Deleted.
2691         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2692
2693 2020-01-31  Don Olmstead  <don.olmstead@sony.com>
2694
2695         [CMake] Add _PRIVATE_LIBRARIES to framework
2696         https://bugs.webkit.org/show_bug.cgi?id=207004
2697
2698         Reviewed by Konstantin Tokarev.
2699
2700         Move uses of PRIVATE within _LIBRARIES to _PRIVATE_LIBRARIES. Any _LIBRARIES appended
2701         afterwards will have that visibility set erroneously.
2702
2703         * CMakeLists.txt:
2704         * PlatformFTW.cmake:
2705         * PlatformGTK.cmake:
2706         * PlatformWin.cmake:
2707
2708 2020-01-31  Zan Dobersek  <zdobersek@igalia.com>
2709
2710         [WPE] Touch-based scrolling roundtrips through the WebProcess
2711         https://bugs.webkit.org/show_bug.cgi?id=206922
2712
2713         Reviewed by Adrian Perez de Castro.
2714
2715         Short-cut the touch events through the ScrollGestureCotroller while it
2716         is actively handling the processed touch events, avoiding roundtrip
2717         through the WebProcess. This effectively means that when the scroll
2718         gesture is in action, any touch events that would affect that gesture
2719         are piped into the controller, producing a corresponding axis event
2720         or ending the gesture.
2721
2722         The ScrollGestureCotroller ownership is moved into the WKWPE::View class
2723         in order to make accessing into that object easier from where the touch
2724         events are handled.
2725
2726         * UIProcess/API/wpe/PageClientImpl.cpp:
2727         (WebKit::PageClientImpl::PageClientImpl):
2728         (WebKit::PageClientImpl::doneWithTouchEvent):
2729         * UIProcess/API/wpe/PageClientImpl.h:
2730         * UIProcess/API/wpe/ScrollGestureController.h:
2731         (WebKit::ScrollGestureController::isHandling const):
2732         * UIProcess/API/wpe/WPEView.cpp:
2733         (WKWPE::View::View):
2734         (WKWPE::m_backend):
2735         * UIProcess/API/wpe/WPEView.h:
2736         (WKWPE::View::scrollGestureController const):
2737
2738 2020-01-30  Jiewen Tan  <jiewen_tan@apple.com>
2739
2740         Add logging to show the flow of AppSSO
2741         https://bugs.webkit.org/show_bug.cgi?id=206778
2742         <rdar://problem/58626835>
2743
2744         Reviewed by Brent Fulgham.
2745
2746         * Platform/Logging.h:
2747         * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm:
2748         (WebKit::SOAuthorizationSession::shouldStart):
2749         (WebKit::SOAuthorizationSession::start):
2750         (WebKit::SOAuthorizationSession::fallBackToWebPath):
2751         (WebKit::SOAuthorizationSession::abort):
2752         (WebKit::SOAuthorizationSession::complete):
2753         (WebKit::SOAuthorizationSession::presentViewController):
2754         (WebKit::SOAuthorizationSession::dismissViewController):
2755
2756 2020-01-30  Jiewen Tan  <jiewen_tan@apple.com>
2757
2758         Unreviewed, another speculative test fix after r255041
2759
2760         * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
2761         (WebKit::MockLocalConnection::getAttestation const):
2762         Adds kSecAttrAccessible: kSecAttrAccessibleAfterFirstUnlock to secItem to bypass
2763         potential error due to screen locks.
2764
2765 2020-01-30  Alex Christensen  <achristensen@webkit.org>
2766
2767         Add WKNavigationDelegate SPI to disable TLS 1.0 and 1.1
2768         https://bugs.webkit.org/show_bug.cgi?id=206979
2769
2770         Reviewed by Brady Eidson.
2771
2772         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
2773         (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
2774         * NetworkProcess/NetworkCORSPreflightChecker.h:
2775         * NetworkProcess/NetworkDataTask.h:
2776         * NetworkProcess/NetworkLoad.cpp:
2777         (WebKit::NetworkLoad::didReceiveChallenge):
2778         * NetworkProcess/NetworkLoad.h:
2779         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2780         (WebKit::NetworkProcessCreationParameters::encode const):
2781         (WebKit::NetworkProcessCreationParameters::decode):
2782         * NetworkProcess/NetworkProcessCreationParameters.h:
2783         * NetworkProcess/NetworkSessionCreationParameters.cpp:
2784         (WebKit::NetworkSessionCreationParameters::encode const):
2785         (WebKit::NetworkSessionCreationParameters::decode):
2786         * NetworkProcess/NetworkSessionCreationParameters.h:
2787         * NetworkProcess/PingLoad.cpp:
2788         (WebKit::PingLoad::didReceiveChallenge):
2789         * NetworkProcess/PingLoad.h:
2790         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
2791         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2792         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
2793         (WebKit::NetworkDataTaskCocoa::didReceiveChallenge):
2794         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
2795         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2796         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2797         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
2798         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2799         (processServerTrustEvaluation):
2800         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
2801         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2802         (WebKit::NetworkSessionCocoa::continueDidReceiveChallenge):
2803         * Shared/Authentication/AuthenticationManager.cpp:
2804         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
2805         * Shared/Authentication/AuthenticationManager.h:
2806         * UIProcess/API/APINavigationClient.h:
2807         (API::NavigationClient::shouldAllowLegacyTLS):
2808         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2809         * UIProcess/Cocoa/NavigationState.h:
2810         * UIProcess/Cocoa/NavigationState.mm:
2811         (WebKit::NavigationState::setNavigationDelegate):
2812         (WebKit::systemAllowsLegacyTLSFor):
2813         (WebKit::NavigationState::NavigationClient::shouldAllowLegacyTLS):
2814         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2815         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2816         * UIProcess/Network/NetworkProcessProxy.cpp:
2817         (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
2818         * UIProcess/Network/NetworkProcessProxy.h:
2819         * UIProcess/Network/NetworkProcessProxy.messages.in:
2820         * UIProcess/WebPageProxy.cpp:
2821         * UIProcess/WebPageProxy.h:
2822         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2823         (WebKit::WebsiteDataStore::parameters):
2824         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
2825
2826 2020-01-30  Tim Horton  <timothy_horton@apple.com>
2827
2828         Can still get stuck after swipe backwards with a slow server, even after r254552
2829         https://bugs.webkit.org/show_bug.cgi?id=207017
2830         <rdar://problem/59016256>
2831
2832         Reviewed by Chris Dumez.
2833
2834         * UIProcess/ProvisionalPageProxy.cpp:
2835         (WebKit::ProvisionalPageProxy::unfreezeLayerTreeDueToSwipeAnimation):
2836         * UIProcess/ProvisionalPageProxy.h:
2837         * UIProcess/WebPageProxy.cpp:
2838         There's a second case where you can get stuck with the "swipe gesture"
2839         layer tree freeze reason in the web process: when doing a cross-origin
2840         navigation where the load takes more than 3 seconds (the swipe
2841         snapshot timeout) to commit, the provisional page will have mirrored
2842         the original page's frozen state upon creation, but will not ever
2843         receive the unfreeze, because it is sent while still provisional.
2844
2845         To fix this, just forward the unfreeze message to the provisional page.
2846
2847 2020-01-30  Per Arne Vollan  <pvollan@apple.com>
2848
2849         [iOS] Issue mach sandbox extension to the frontboard and icon service when the attachment element is enabled
2850         https://bugs.webkit.org/show_bug.cgi?id=205443
2851         <rdar://problem/58074291>
2852
2853         Reviewed by Brent Fulgham.
2854
2855         When support for the html attachment element is enabled, issue a mach lookup extension to the frontboard and icon service
2856         for the WebContent process, since these daemons are being contacted when icons for attachments are being queried. Also,
2857         retrieve the focus ring color in the UI process, since getting this color requires access to the frontboard daemon.
2858
2859         Test: fast/sandbox/ios/sandbox-mach-lookup-attachment-element.html
2860
2861         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2862         * Shared/WebProcessCreationParameters.cpp:
2863         (WebKit::WebProcessCreationParameters::encode const):
2864         (WebKit::WebProcessCreationParameters::decode):
2865         * Shared/WebProcessCreationParameters.h:
2866         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2867         (WebKit::WebProcessPool::platformInitializeWebProcess):
2868         * WebProcess/cocoa/WebProcessCocoa.mm:
2869         (WebKit::WebProcess::platformInitializeWebProcess):
2870
2871 2020-01-30  Tim Horton  <timothy_horton@apple.com>
2872
2873         REGRESSION (r253267): Swipe from edge on Twitter images no longer goes back
2874         https://bugs.webkit.org/show_bug.cgi?id=207011
2875         <rdar://problem/58966044>
2876
2877         Reviewed by Wenson Hsieh.
2878
2879         * UIProcess/ios/WKContentViewInteraction.mm:
2880         (-[WKContentView deferringGestureRecognizer:shouldDeferOtherGestureRecognizer:]):
2881         The new touch-event async deferring gesture recognizer was erroneously deferring
2882         edge swipes, which are not allowed to be blocked by touch events.
2883         Opt them out of the new gesture gate mechanism.
2884
2885 2020-01-30  Jonathan Bedard  <jbedard@apple.com>
2886
2887         PAL: Remove old iOS version macros
2888         https://bugs.webkit.org/show_bug.cgi?id=206905
2889
2890         Reviewed by Darin Adler.
2891
2892         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm: Remove USE(NSPROGRESS_PUBLISHING_SPI)
2893         * NetworkProcess/Downloads/cocoa/WKDownloadProgress.mm: Ditto.
2894
2895 2020-01-30  youenn fablet  <youenn@apple.com>
2896
2897         Disable Service Workers before terminating an unresponsive service worker process
2898         https://bugs.webkit.org/show_bug.cgi?id=206994
2899
2900         Reviewed by Chris Dumez.
2901
2902         In case a process becomes unresponsive, we terminate it in case it is a service worker process.
2903         In that case, we should make sure not to call the service worker process crash callback.
2904         To do so, disable service workers before terminating the IPC connection.
2905
2906         * UIProcess/WebProcessProxy.cpp:
2907         (WebKit::WebProcessProxy::didBecomeUnresponsive):
2908
2909 2020-01-30  Brent Fulgham  <bfulgham@apple.com>
2910
2911         [iOS] Remove report rule for 'com.apple.runningboard' from the Network and GPU process sandboxes
2912         https://bugs.webkit.org/show_bug.cgi?id=206980
2913         <rdar://problem/58900030>
2914
2915         Reviewed by Maciej Stachowiak.
2916
2917         Remove the logging now that we have useful backtraces.
2918
2919         * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb:
2920         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
2921
2922 2020-01-30  youenn fablet  <youenn@apple.com>
2923
2924         [Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder
2925         https://bugs.webkit.org/show_bug.cgi?id=206582
2926
2927         Reviewed by Eric Carlson.
2928
2929         * GPUProcess/webrtc/RemoteMediaRecorder.cpp:
2930         (WebKit::RemoteMediaRecorder::create):
2931         Use new constructor.
2932
2933 2020-01-30  Carlos Garcia Campos  <cgarcia@igalia.com>
2934
2935         REGRESSION(r253636): [GTK] Mouse cursor changes using onMouseXYZ are erratic
2936         https://bugs.webkit.org/show_bug.cgi?id=206454
2937
2938         Reviewed by Tim Horton.
2939
2940         Since r253636 only platforms defining HAVE_NSCURSOR claim to support setting the cursor.
2941
2942         * WebProcess/WebCoreSupport/WebChromeClient.h: Do not implement supportsSettingCursor() for GTK port either.
2943
2944 2020-01-29  Tim Horton  <timothy_horton@apple.com>
2945
2946         REGRESSION (r255322): macCatalyst: Tapping in an input field doesn't change the selection location
2947         https://bugs.webkit.org/show_bug.cgi?id=206978
2948
2949         Reviewed by Wenson Hsieh.
2950
2951         * WebProcess/WebCoreSupport/WebChromeClient.h:
2952         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
2953         (WebKit::WebChromeClient::shouldUseMouseEventForSelection):
2954         (WebKit::WebChromeClient::shouldUseMouseEventsForSelection): Deleted.
2955         Allow single-click events to change the selection; this is required
2956         in order to allow WebCore to set the selection in the case that
2957         the UITextInteraction gestures haven't yet been installed. Continue
2958         to not allow multi-click events to change the selection, because
2959         these are the ones that conflict with UIKit's behaviors.
2960
2961 2020-01-29  Commit Queue  <commit-queue@webkit.org>
2962
2963         Unreviewed, rolling out r254379.
2964         https://bugs.webkit.org/show_bug.cgi?id=206969
2965
2966         Introduced media regressions (Requested by perarne on
2967         #webkit).
2968
2969         Reverted changeset:
2970
2971         "[iOS] Remove used media-related mach services from the
2972         WebContent process sandbox"
2973         https://bugs.webkit.org/show_bug.cgi?id=206089
2974         https://trac.webkit.org/changeset/254379
2975
2976 2020-01-29  Per Arne Vollan  <pvollan@apple.com>
2977
2978         [iOS] Deny mach lookup access to aggregate service
2979         https://bugs.webkit.org/show_bug.cgi?id=206710
2980         <rdar://problem/57914492>
2981
2982         Reviewed by Darin Adler.
2983
2984         Tighten sandbox by denying access to this service.
2985
2986         Test: fast/sandbox/ios/sandbox-mach-lookup.html
2987
2988         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2989
2990 2020-01-29  Wenson Hsieh  <wenson_hsieh@apple.com>
2991
2992         [iPadOS] Select popovers on amazon.com sometimes dismiss immediately after appearing
2993         https://bugs.webkit.org/show_bug.cgi?id=206948
2994         <rdar://problem/58954516>
2995
2996         Reviewed by Tim Horton.
2997
2998         Amazon adds active touchstart event listeners to their select elements, where they call preventDefault() and
2999         programmatically focus the select element. Doing so prevents clicks from being dispatched by allowing the web
3000         touch event gesture to recognize instead of the synthetic click gesture, which (inside -_singleTapRecognized:)
3001         would otherwise dismiss any currently presented popover.
3002
3003         After making touchstart events dispatch asynchronously, preventing touchstart no longer causes other native
3004         gestures (such as the synthetic click gesture) to fail in the case where there is a sync touchmove or touchend
3005         event listener, and the touch gesture has ended before the touchstart handler has finished executing and told
3006         the UI process whether or not the touch was handled. This is because the touchend or touchmove is dispatched
3007         synchronously while the touchstart is still being processed; while the web page sees the correct order of
3008         events, the UI process will end up learning that the synchronous touch was handled before the response to the
3009         asynchronously dispatched touchstart event has arrived.
3010
3011         Our current logic in the sync touch event dispatch case then unconditionally ends gesture deferral by calling
3012         `doneDeferringNativeGestures` with `handled` equal to whether or not the touch event (a "touchend", in this
3013         case) had been handled. However, in the case where touchstart event is prevented but the touchend event is not,
3014         this will cause us to prematurely stop deferring gestures even though the page called `preventDefault()` in the
3015         touchstart event handler, and allow the synthetic click gesture to recognize when it shouldn't.
3016
3017         To fix this, keep deferring native gestures after handling a sync touch in the case where a touchstart event is
3018         still being handled; instead, remember whether the touch event was handled using a new member variable
3019         (`m_handledSynchronousTouchEventWhileDispatchingPreventableTouchStart`), and consult this when the response to
3020         the touchstart has been received in the UI process to determine whether platform gestures should be allowed to
3021         recognize. This variable is reset once we're done handling the touchstart.
3022
3023         Test: fast/events/touch/ios/prevent-default-with-slow-touchstart-handler.html
3024
3025         * UIProcess/WebPageProxy.cpp:
3026         (WebKit::WebPageProxy::handlePreventableTouchEvent):
3027         * UIProcess/WebPageProxy.h:
3028
3029 2020-01-29  Chris Dumez  <cdumez@apple.com>
3030
3031         [iOS] Make sure unused service worker processes exit promptly on low memory warning
3032         https://bugs.webkit.org/show_bug.cgi?id=206939
3033         <rdar://problem/58972717>
3034
3035         Reviewed by Alex Christensen.
3036
3037         Make sure unused service worker processes exit promptly on low memory warning. They normally take 10 seconds to exit
3038         for performance reasons. However, in case of memory pressure, keeping those processes around that long is not the
3039         right thing to do.
3040
3041         * NetworkProcess/NetworkProcess.cpp:
3042         (WebKit::NetworkProcess::lowMemoryHandler):
3043
3044 2020-01-29  Chris Dumez  <cdumez@apple.com>
3045
3046         Unreviewed, fix Catalyst build after r255366
3047
3048         * Shared/WebPreferencesDefaultValues.cpp:
3049         (WebKit::defaultDisallowSyncXHRDuringPageDismissalEnabled):
3050         * Shared/WebPreferencesDefaultValues.h:
3051         * Shared/ios/WebPreferencesDefaultValuesIOS.mm:
3052
3053 2020-01-29  Sihui Liu  <sihui_liu@apple.com>
3054
3055         Crash under com.apple.WebKit.Networking at WebKit: WebKit::WebIDBServer::suspend
3056         https://bugs.webkit.org/show_bug.cgi?id=206904
3057         <rdar://problem/58791603>
3058
3059         Reviewed by Maciej Stachowiak.
3060
3061         Wait until m_server is set in constructor of WebIDBServer to make sure m_server can be accessed in 
3062         WebIDBServer::suspend.
3063
3064         * NetworkProcess/IndexedDB/WebIDBServer.cpp:
3065         (WebKit::WebIDBServer::WebIDBServer):
3066
3067 2020-01-29  Brent Fulgham  <bfulgham@apple.com>
3068
3069         Unreviewed, rolling out r255217 and r255217.
3070
3071         * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in:
3072         * WebProcess/com.apple.WebProcess.sb.in:
3073
3074 2020-01-29  Chris Dumez  <cdumez@apple.com>
3075
3076         [iOS] Add managed preference to allow legacy sync XHRs during page dismissal
3077         https://bugs.webkit.org/show_bug.cgi?id=206944
3078         <rdar://problem/58440111>
3079
3080         Reviewed by Alex Christensen.
3081
3082         Add managed preference for iOS to allow enterprise customers to keep using legacy sync XHRs
3083         during page dismissal.
3084
3085         * Shared/WebPreferencesDefaultValues.cpp:
3086         (WebKit::defaultDisallowSyncXHRDuringPageDismissalEnabled):
3087         * Shared/WebPreferencesDefaultValues.h:
3088         * Shared/ios/WebPreferencesDefaultValuesIOS.mm:
3089         (WebKit::allowsDeprecatedSynchronousXMLHttpRequestDuringUnload):
3090
3091 2020-01-29  Carlos Garcia Campos  <cgarcia@igalia.com>
3092
3093         Unreviewed. Move unsetenv to WebProcessMain.cpp after r255342
3094
3095         I forgot to do that before landing the patch.
3096
3097         * WebProcess/EntryPoint/unix/WebProcessMain.cpp:
3098         (main):
3099         * WebProcess/gtk/WebProcessMainGtk.cpp:
3100
3101 2020-01-29  youenn fablet  <youenn@apple.com>
3102
3103         Send WebsiteDataStore media parameters to GPUProcess when needed
3104         https://bugs.webkit.org/show_bug.cgi?id=206870
3105
3106         Reviewed by Eric Carlson.
3107
3108         Whenever opening a new WebProcess/GPUProcess connection, make sure GPUProcess knows WebProcess session parameters.
3109         Make sure to remove session parameters when data store is destroyed.
3110         Update media code to no longer send the corresponding parameters for each media load.
3111
3112         Covered by existing tests no longer triggering sandbox violations.
3113
3114         * GPUProcess/GPUConnectionToWebProcess.cpp:
3115         (WebKit::GPUConnectionToWebProcess::mediaCacheDirectory const):
3116         (WebKit::GPUConnectionToWebProcess::mediaKeysStorageDirectory const):
3117         * GPUProcess/GPUConnectionToWebProcess.h:
3118         * GPUProcess/GPUProcess.cpp:
3119         (WebKit::GPUProcess::addSession):
3120         (WebKit::GPUProcess::removeSession):
3121         (WebKit::GPUProcess::mediaCacheDirectory const):
3122         (WebKit::GPUProcess::mediaKeysStorageDirectory const):
3123         * GPUProcess/GPUProcess.h:
3124         * GPUProcess/GPUProcess.messages.in:
3125         * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
3126         (WebKit::RemoteMediaPlayerProxy::load):
3127         (WebKit::RemoteMediaPlayerProxy::mediaPlayerMediaKeysStorageDirectory const):
3128         (WebKit::RemoteMediaPlayerProxy::mediaPlayerMediaCacheDirectory const):
3129         * GPUProcess/media/RemoteMediaPlayerProxy.h:
3130         * GPUProcess/media/RemoteMediaPlayerProxyConfiguration.h:
3131         (WebKit::RemoteMediaPlayerProxyConfiguration::encode const):
3132         (WebKit::RemoteMediaPlayerProxyConfiguration::decode):
3133         * UIProcess/GPU/GPUProcessProxy.cpp:
3134         (WebKit::GPUProcessProxy::singleton):
3135         (WebKit::GPUProcessProxy::openGPUProcessConnection):
3136         (WebKit::gpuProcessSessionParameters):
3137         (WebKit::GPUProcessProxy::addSession):
3138         (WebKit::GPUProcessProxy::removeSession):
3139         * UIProcess/GPU/GPUProcessProxy.h:
3140         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3141         (WebKit::WebsiteDataStore::~WebsiteDataStore):
3142         * WebKit.xcodeproj/project.pbxproj:
3143         * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
3144         (WebKit::RemoteMediaPlayerManager::createRemoteMediaPlayer):
3145
3146 2020-01-29  youenn fablet  <youenn@apple.com>
3147
3148         [Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder
3149         https://bugs.webkit.org/show_bug.cgi?id=206582
3150
3151         Reviewed by Eric Carlson.
3152
3153         * GPUProcess/webrtc/RemoteMediaRecorder.cpp:
3154         (WebKit::RemoteMediaRecorder::create):
3155         Use new constructor.
3156
3157 2020-01-29  Carlos Garcia Campos  <cgarcia@igalia.com>
3158
3159         [GTK] WebDriver: screenshot ignores CSS transformations or WebGL content.
3160         https://bugs.webkit.org/show_bug.cgi?id=206514
3161
3162         Reviewed by Carlos Alberto Lopez Perez.
3163
3164         WebPage::scaledSnapshotWithOptions() doesn't work when accelerated compositing is enabled. To fix this, we
3165         need to take the screenshot from the UI process, like we do for the layout tests.
3166
3167         * UIProcess/API/gtk/PageClientImpl.cpp:
3168         (WebKit::PageClientImpl::takeViewSnapshot): Pass clip rectangle to webkitWebViewBaseTakeViewSnapshot.
3169         * UIProcess/API/gtk/PageClientImpl.h:
3170         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3171         (webkitWebViewBaseTakeViewSnapshot): Use the given clip rectangle if not nullopt.
3172         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
3173         * UIProcess/Automation/WebAutomationSession.cpp:
3174         (WebKit::WebAutomationSession::takeScreenshot): In case of full web view snapshot just call
3175         WebPageProxy::takeViewSnapshot() with a nullopt clip rectangle. In case of element snapshot, send
3176         SnapshotRectForScreenshot message to the web process to get the clip rectangle and then call
3177         WebPageProxy::takeViewSnapshot().
3178         (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData): Empty implementation for other ports.
3179         * UIProcess/Automation/WebAutomationSession.h: Make platformGetBase64EncodedPNGData() static.
3180         * UIProcess/Automation/cairo/WebAutomationSessionCairo.cpp:
3181         (WebKit::base64EncodedPNGData): Moved common code to this new function.
3182         (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData): New function to get the encoded PNG from a ViewSnapshot.
3183         * UIProcess/PageClient.h: Add optional clip rectangle parameter to takeViewSnapshot().
3184         * UIProcess/ViewSnapshotStore.cpp:
3185         (WebKit::ViewSnapshotStore::recordSnapshot): Pass nullopt to takeViewSnapshot().
3186         * UIProcess/WebPageProxy.cpp:
3187         * UIProcess/WebPageProxy.h:
3188         * UIProcess/ios/PageClientImplIOS.h:
3189         * UIProcess/ios/PageClientImplIOS.mm:
3190         (WebKit::PageClientImpl::takeViewSnapshot):
3191         * UIProcess/mac/PageClientImplMac.h:
3192         * UIProcess/mac/PageClientImplMac.mm:
3193         (WebKit::PageClientImpl::takeViewSnapshot):
3194         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
3195         (WebKit::snapshotElementRectForScreenshot): Renamed to avoid conflict with new IPC message handler.
3196         (WebKit::WebAutomationSessionProxy::takeScreenshot): Call snapshotRectForScreenshot() to get the snapshot
3197         rectangle and convert it to document coords.
3198         (WebKit::WebAutomationSessionProxy::snapshotRectForScreenshot): Get the snapshot rectangle in client coords.
3199         (WebKit::snapshotRectForScreenshot): Deleted.
3200         * WebProcess/Automation/WebAutomationSessionProxy.h:
3201         * WebProcess/Automation/WebAutomationSessionProxy.messages.in: Add SnapshotRectForScreenshot message.
3202
3203 2020-01-28  Carlos Garcia Campos  <cgarcia@igalia.com>
3204
3205         [GTK] Should use light theme unless website declares support for dark themes in color-schemes property
3206         https://bugs.webkit.org/show_bug.cgi?id=197947
3207
3208         Reviewed by Michael Catanzaro.
3209
3210         Handle the theme changes in the UI process, converting dark variant to the light one before sending the theme
3211         name to the web process. The web process is still notified when a dark theme is in use, so that if website
3212         prefers a dark color scheme it will be used, but the gtk theme that will be used for controls styling will
3213         always be light.
3214
3215         * Shared/WebPageCreationParameters.cpp:
3216         (WebKit::WebPageCreationParameters::encode const): Encode themeName.
3217         (WebKit::WebPageCreationParameters::decode): Decode themeName.
3218         * Shared/WebPageCreationParameters.h:
3219         * UIProcess/API/gtk/PageClientImpl.cpp:
3220         (WebKit::PageClientImpl::themeName const): Get the theme name that should be used by the web process.
3221         * UIProcess/API/gtk/PageClientImpl.h:
3222         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3223         (themeChanged): Call WebPageProxy::themeDidChange().
3224         (applicationPreferDarkThemeChanged):
3225         (webkitWebViewBaseSetToplevelOnScreenWindow): Use a different callback for the theme name change.
3226         * UIProcess/PageClient.h:
3227         * UIProcess/WebPageProxy.cpp:
3228         * UIProcess/WebPageProxy.h:
3229         * UIProcess/gtk/WebPageProxyGtk.cpp:
3230         (WebKit::WebPageProxy::themeDidChange): Send ThemeDidChange message to the web process with the theme name to use.
3231         * WebProcess/WebPage/WebPage.cpp:
3232         (WebKit::WebPage::WebPage): Initialize the theme name.
3233         (WebKit::WebPage::effectiveAppearanceDidChange): Use this now for GTK port too.
3234         * WebProcess/WebPage/WebPage.h:
3235         * WebProcess/WebPage/WebPage.messages.in: Add ThemeDidChange message.
3236         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
3237         (WebKit::WebPage::themeDidChange): Set the theme given name in gtk settings.
3238         * WebProcess/gtk/WebProcessMainGtk.cpp:
3239
3240 2020-01-28  Timothy Horton  <timothy_horton@apple.com>
3241
3242         Fix the build
3243
3244         * UIProcess/ios/WKMouseGestureRecognizer.mm:
3245         (-[WKMouseGestureRecognizer touchesEnded:withEvent:]):
3246
3247 2020-01-28  Tim Horton  <timothy_horton@apple.com>
3248
3249         macCatalyst: Right clicking on a link follows it immediately
3250         https://bugs.webkit.org/show_bug.cgi?id=206919
3251         <rdar://problem/58936679>
3252
3253         Reviewed by Wenson Hsieh.
3254
3255         * UIProcess/ios/WKMouseGestureRecognizer.mm:
3256         (-[WKMouseGestureRecognizer createMouseEventWithType:forEvent:]):
3257         (-[WKMouseGestureRecognizer touchesBegan:withEvent:]):
3258         (-[WKMouseGestureRecognizer touchesEnded:withEvent:]):
3259         UIKit's _buttonMask does not include the currently-released button,
3260         so in order to correctly identify the released button in touchesEnded,
3261         store the mask for the length of the click.
3262
3263 2020-01-28  Tim Horton  <timothy_horton@apple.com>
3264
3265         macCatalyst: Triple clicking to select a sentence results in an empty selection
3266         https://bugs.webkit.org/show_bug.cgi?id=206863
3267         <rdar://problem/58776993>
3268
3269         Reviewed by Wenson Hsieh.
3270
3271         * UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h:
3272         * UIProcess/API/Cocoa/WKWebViewTesting.mm:
3273         (-[WKWebView _doAfterProcessingAllPendingMouseEvents:]):
3274         * UIProcess/API/mac/WKWebViewPrivateForTestingMac.h:
3275         * UIProcess/API/mac/WKWebViewTestingMac.mm:
3276         (-[WKWebView _doAfterProcessingAllPendingMouseEvents:]): Deleted.
3277         * UIProcess/Cocoa/WebViewImpl.h:
3278         * UIProcess/Cocoa/WebViewImpl.mm:
3279         (WebKit::WebViewImpl::handleProcessSwapOrExit):
3280         (WebKit::WebViewImpl::doAfterProcessingAllPendingMouseEvents): Deleted.
3281         (WebKit::WebViewImpl::didFinishProcessingAllPendingMouseEvents): Deleted.
3282         (WebKit::WebViewImpl::flushPendingMouseEventCallbacks): Deleted.
3283         * UIProcess/PageClient.h:
3284         * UIProcess/WebPageProxy.cpp:
3285         (WebKit::WebPageProxy::doAfterProcessingAllPendingMouseEvents):
3286         (WebKit::WebPageProxy::didFinishProcessingAllPendingMouseEvents):
3287         (WebKit::WebPageProxy::flushPendingMouseEventCallbacks):
3288         * UIProcess/WebPageProxy.h:
3289         * UIProcess/ios/PageClientImplIOS.h:
3290         * UIProcess/mac/PageClientImplMac.h:
3291         * UIProcess/mac/PageClientImplMac.mm:
3292         (WebKit::PageClientImpl::didFinishProcessingAllPendingMouseEvents): Deleted.
3293         Move "doAfterProcessingAllPendingMouseEvents" to WebPage instead of WebViewImpl,
3294         so it can be used on all platforms. Expose it via WKWebView.
3295
3296         * WebProcess/WebCoreSupport/WebChromeClient.h:
3297         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
3298         (WebKit::WebChromeClient::shouldUseMouseEventsForSelection):
3299
3300 2020-01-28  Andres Gonzalez  <andresg_22@apple.com>
3301
3302         Fix for crash in AppKit accessibility.
3303         https://bugs.webkit.org/show_bug.cgi?id=206902
3304
3305         Reviewed by Chris Fleizach.
3306
3307         Accessibility methods invoked in the secondary thread that Return id
3308         values retrieved from the main thread, need to retain/autoRelease the returned ids.
3309
3310         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
3311         (-[WKAccessibilityWebPageObject ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
3312         (-[WKAccessibilityWebPageObject accessibilityAttributeSizeValue]):
3313         (-[WKAccessibilityWebPageObject accessibilityAttributePositionValue]):
3314         (-[WKAccessibilityWebPageObject accessibilityDataDetectorValue:point:]):
3315
3316 2020-01-28  Brent Fulgham  <bfulgham@apple.com>
3317
3318         Unreviewed test fix after r255217
3319
3320         Re-activate SecurityServer mach port access in Catalina and older.
3321
3322         * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in:
3323         * WebProcess/com.apple.WebProcess.sb.in:
3324
3325 2020-01-28  Brent Fulgham  <bfulgham@apple.com>
3326
3327         Reset the application bundle identifier between test runs
3328         https://bugs.webkit.org/show_bug.cgi?id=206858
3329         <rdar://problem/58844002>
3330
3331         Reviewed by Per Arne Vollan.
3332
3333         Clear the application bundle identifier set during testing when resetting the test system
3334         to a known state in preparation for the next run.
3335
3336         Tests: fast/sandbox/ios/sandbox-mach-lookup.html, fast/sandbox/ios/sandbox-mach-lookup-mail.html
3337
3338         * UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h:
3339         * UIProcess/API/Cocoa/WKWebViewTesting.mm:
3340         (+[WKWebView _clearApplicationBundleIdentifierTestingOverride]): Added.
3341
3342 2020-01-24  Sergio Villar Senin  <svillar@igalia.com>
3343
3344         Remove WebVR from the tree
3345         https://bugs.webkit.org/show_bug.cgi?id=206739
3346
3347         Reviewed by Darin Adler.
3348
3349         * Shared/WebPreferences.yaml: removed WebVR preference.
3350
3351 2020-01-28  youenn fablet  <youenn@apple.com>
3352
3353         Remove unneeded message checks in GPUProcess code
3354         https://bugs.webkit.org/show_bug.cgi?id=206866
3355
3356         Reviewed by Eric Carlson.
3357
3358         Remove message check macros and checks since they are not needed due to the use of ObjectIdentifier.
3359         No change of behavior.
3360
3361         * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp:
3362         (WebKit::RemoteMediaPlayerManagerProxy::createMediaPlayer):
3363         * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
3364
3365 2020-01-27  Antoine Quint  <graouts@apple.com>
3366
3367         [Web Animations] Make Animation.timeline read-write only if a runtime flag is enabled
3368         https://bugs.webkit.org/show_bug.cgi?id=206173
3369         <rdar://problem/58527432>
3370
3371         Reviewed by Dean Jackson.
3372
3373         Add a new WebAnimationsMutableTimelines runtime flag.
3374
3375         * Shared/WebPreferences.yaml:
3376
3377 2020-01-28  Carlos Garcia Campos  <cgarcia@igalia.com>
3378
3379         [GTK][WPE] QR code not loaded in web.whatsapp.com
3380         https://bugs.webkit.org/show_bug.cgi?id=203404
3381
3382         Reviewed by Michael Catanzaro.
3383
3384         This is a regression of the switch to use libsoup API for the WebSockets implementation. The QR code is loaded
3385         using a WebSocket connection, but the server is always replying with a 400 Bad Request to the Upgrade requests
3386         coming from an existing HTTP connection. We need to ensure a new dedicated connection is used for WebSockets.
3387
3388         * NetworkProcess/soup/WebSocketTaskSoup.cpp:
3389         (WebKit::WebSocketTask::WebSocketTask): Set the SOUP_MESSAGE_NEW_CONNECTION flag to the SoupMessage before
3390         starting the connection.
3391
3392 2020-01-27  Carlos Garcia Campos  <cgarcia@igalia.com>
3393
3394         [GTK] Remote Inspector: add support for service workers targets
3395         https://bugs.webkit.org/show_bug.cgi?id=206821
3396
3397         Reviewed by Žan Doberšek.
3398
3399         Add support for debugging service workers.
3400
3401         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
3402         (WebKit::RemoteInspectorProtocolHandler::handleRequest): Pass target type to message handler too.
3403         (WebKit::RemoteInspectorProtocolHandler::inspect): Pass the received target type to the client.
3404         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.h:
3405         * UIProcess/glib/RemoteInspectorClient.cpp:
3406         (WebKit::RemoteInspectorProxy::load): It now receives the debuggable type that is set to the API::DebuggableInfo.
3407         (WebKit::RemoteInspectorClient::messageHandlers): Handle service worker targets too.
3408         (WebKit::debuggableType): Helper to convert the target type to debuggable type.
3409         (WebKit::RemoteInspectorClient::inspect): Pass the debuggable tupe to RemoteInspectorProxy::load().
3410         * UIProcess/glib/RemoteInspectorClient.h:
3411         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
3412         (WebKit::WebInspectorProxy::infoForLocalDebuggable): Use WebPage as debuggable type instead of the default.
3413
3414 2020-01-27  Simon Fraser  <simon.fraser@apple.com>
3415
3416         REGRESSION (r253634): cricbuzz.com media controls vanish depending on page scale
3417         https://bugs.webkit.org/show_bug.cgi?id=206788
3418         rdar://problem/58780584
3419
3420         Reviewed by Tim Horton.
3421
3422         r253634 changed "delegatesPageScaling"'" to a flag on ScrollView. However, this changed behavior
3423         for subframes; Settings are propagated down, but only the main ScrollView had delegatesPageScaling
3424         set on it.
3425         
3426         "delegatesPageScaling" is a page-level thing (subframes don't independently zoom), so it
3427         should live on Page. Move it there.
3428         
3429         The bug was triggered by incorrectly taking page scale into account for rects in the compositing
3430         overlap map (see RenderLayerCompositor::addToOverlapMap()) in subframes, and those rects
3431         changing on zoom.
3432
3433         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3434         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
3435         * WebProcess/WebPage/ios/FindControllerIOS.mm:
3436         (WebKit::FindIndicatorOverlayClientIOS::drawRect):
3437
3438 2020-01-27  Fujii Hironori  <Hironori.Fujii@sony.com>
3439
3440         [WinCairo][curl] ASSERTION FAILED: sessionID != PAL::SessionID::defaultSessionID() in WebKit::CacheStorage::Engine::destroyEngine since r255137
3441         https://bugs.webkit.org/show_bug.cgi?id=206859
3442
3443         Reviewed by Don Olmstead.
3444
3445         After r255137, WinCairo debug WK2 is still failing an assertion
3446         while shutdown, which is ensuring the destructing session isn't
3447         the default session.
3448
3449         * NetworkProcess/cache/CacheStorageEngine.cpp:
3450         (WebKit::CacheStorage::Engine::destroyEngine): Conditioned out the
3451         assertion for curl port as well as Soup port does.
3452
3453 2020-01-27  David Quesada  <david_quesada@apple.com>
3454
3455         Support observing a different set of view service state notifications in ApplicationStateTracker
3456         https://bugs.webkit.org/show_bug.cgi?id=201737
3457         rdar://problem/54786414
3458
3459         Reviewed by Chris Dumez.
3460
3461         * UIProcess/ApplicationStateTracker.mm:
3462         Make ApplicationStateTracker conditionally (based on a flag to be defined in WebKitAdditions)
3463         use a different pair of notifications when it is in a view service or extension. These
3464         notifications report state changes of the individual scene that hosts the web view, rather
3465         than the state of the overall host application. This allows for more accurate state tracking
3466         for web views in extensions or view services hosted by apps with multiple open scenes.
3467