faa3f33a9b165aa5c51cee5d629c3efa2fea4e8c
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2020-05-10  Michael Catanzaro  <mcatanzaro@gnome.org>
2
3         REGRESSION(r261270): Broke build with python3
4         https://bugs.webkit.org/show_bug.cgi?id=211699
5
6         Reviewed by Yusuke Suzuki.
7
8         Remove the problematic print statement. It causes the script to fail. If fixed, it spams the
9         build output. We only print messages during the build when there are problems to be fixed.
10
11         * Scripts/generate-message-receiver.py:
12         (main):
13
14 2020-05-10  Tim Horton  <timothy_horton@apple.com>
15
16         Clicking a tel:// link on iPad with a trackpad presents different UI than tapping on it
17         https://bugs.webkit.org/show_bug.cgi?id=211686
18         <rdar://problem/57941589>
19
20         Reviewed by Wenson Hsieh.
21
22         Previously, iOS WebKit had code in handleTap, handleTwoFingerTapAtPoint, and commitPotentialTap,
23         which introspected the hit element /before/ dispatching the tap (or synthetic click) to the DOM,
24         short circuiting all normal event handling machinery in order to prevent the default action
25         and present the Data Detectors UI for the given link.
26
27         There's one immediate problem with this, which is that there is no similar code in the direct
28         click event handler path, which we now use for trackpad/mouse input on iPad. There's also a
29         secondary problem (which we have not seen in practice), which is that pages cannot preventDefault
30         to avoid launching the Data Detectors UI on a link, like they could to prevent an ordinary
31         link from being followed.
32
33         In order to resolve both issues and reduce duplication of logic, move the code that introspects
34         the element and invokes Data Detectors UI from high-level WebKit event dispatch code (where it
35         doesn't really belong) down to WebCore's default click event handler for anchors, right next to
36         the code that would ordinarily cause a navigation. This way, no matter how we get here, whether
37         by synthetic click or real click, we'll invoke the Data Detectors UI.
38
39         One alternative considered at length: we could actually let the navigation happen, and instead
40         handle the switch in navigation policy code, but there are a few reasons that did not seem ideal:
41         1) We'd need to plumb platform-specific data structures through a ton of FrameLoader code.
42         2) Clients often block non-HTTP(S) navigations, so in order to keep the feature functional,
43            we'd have to disregard the client's policy decision, defeating much of the purpose of making
44            use of the navigation mechanism in the first place.
45
46         * UIProcess/PageClient.h:
47         * UIProcess/WebPageProxy.h:
48         * UIProcess/WebPageProxy.messages.in:
49         * UIProcess/ios/PageClientImplIOS.h:
50         * UIProcess/ios/PageClientImplIOS.mm:
51         (WebKit::PageClientImpl::showDataDetectorsUIForPositionInformation):
52         * UIProcess/ios/WebPageProxyIOS.mm:
53         (WebKit::WebPageProxy::showDataDetectorsUIForPositionInformation):
54         * WebProcess/WebCoreSupport/WebChromeClient.h:
55         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
56         (WebKit::WebChromeClient::showDataDetectorsUIForElement):
57         Plumb showDataDetectorsUIForPositionInformation from iOS WebKit's ChromeClient
58         implementation all the way to WKContentView.
59
60         * UIProcess/ios/WKActionSheetAssistant.h:
61         * UIProcess/ios/WKActionSheetAssistant.mm:
62         (-[WKActionSheetAssistant showDataDetectorsUIForPositionInformation:]):
63         (-[WKActionSheetAssistant contextMenuInteraction:configurationForMenuAtLocation:]):
64         (-[WKActionSheetAssistant contextMenuInteraction:previewForHighlightingMenuWithConfiguration:]):
65         (-[WKActionSheetAssistant showDataDetectorsSheet]): Deleted.
66         Make it possible to push InteractionInformationAtPosition into WKActionSheetAssistant,
67         instead of having it always pull a fresh one upon invocation, so that we can use the
68         position information passed along with the showDataDetectorsUIForPositionInformation message.
69
70         (-[WKActionSheetAssistant _contextMenuInteraction:overrideSuggestedActionsForConfiguration:]):
71         (-[WKActionSheetAssistant suggestedActionsForContextMenuWithPositionInformation:]):
72         Fix an existing bug where Data Detectors context menus would show extra default actions,
73         by moving our implementation of the -_contextMenuInteraction:overrideSuggestedActionsForConfiguration:
74         delegate here, sharing it with WKContentViewInteraction.
75
76         In a future patch, we should reconsider having three separate UIContextMenuInteractions.
77
78         Also, remove the contextMenuPresentationLocationForActionSheetAssistant: delegate,
79         since it will be wrong in the case of pushed-in position information, and instead
80         use the position information's original hit test point.
81
82         * UIProcess/ios/WKContentViewInteraction.h:
83         * UIProcess/ios/WKContentViewInteraction.mm:
84         (-[WKContentView _showDataDetectorsUI]):
85         (-[WKContentView _showDataDetectorsUIForPositionInformation:]):
86         (-[WKContentView _actionForLongPressFromPositionInformation:]):
87         (-[WKContentView _didNotHandleTapAsClick:]):
88         (-[WKContentView dataDetectionContextForPositionInformation:]):
89         (-[WKContentView dataDetectionContextForActionSheetAssistant:positionInformation:]):
90         (-[WKContentView _showDataDetectorsSheet]): Deleted.
91         (-[WKContentView currentPositionInformation]): Deleted.
92         (-[WKContentView dataDetectionContextForActionSheetAssistant:]): Deleted.
93         Instead of exposing an unnecessary -currentPositionInformation getter on WKActionSheetAssistant,
94         provide it as an argument to the WKActionSheetAssistantDelegate methods that actually need it.
95
96         (-[WKContentView contextMenuPresentationLocationForActionSheetAssistant:]): Deleted.
97         (-[WKContentView _contextMenuInteraction:overrideSuggestedActionsForConfiguration:]):
98         Adopt WKActionSheetAssistant's suggestedActions mechanism so we can share code.
99
100         * UIProcess/ios/WKPDFView.mm:
101         (-[WKPDFView _showActionSheetForURL:atLocation:withAnnotationRect:]):
102         (-[WKPDFView dataDetectionContextForActionSheetAssistant:positionInformation:]):
103         (-[WKPDFView dataDetectionContextForActionSheetAssistant:]): Deleted.
104         Adapt to some WKActionSheetAssistantDelegate changes.
105
106         * WebProcess/WebPage/WebPage.h:
107         * WebProcess/WebPage/ios/WebPageIOS.mm:
108         (WebKit::WebPage::handleTap):
109         (WebKit::WebPage::handleTwoFingerTapAtPoint):
110         (WebKit::WebPage::commitPotentialTap):
111         Remove the aforementioned short-circuiting paths for Data Detectors links.
112 2020-05-09  David Kilzer  <ddkilzer@apple.com>
113
114         Attempt #2 to fix internal iOS build
115
116         * UIProcess/ios/WKMouseGestureRecognizer.mm:
117         - Use ALLOW_DEPRECATED_IMPLEMENTATIONS_{BEGIN,END}.
118
119 2020-05-09  David Kilzer  <ddkilzer@apple.com>
120
121         Attemp to fix internal iOS build
122
123         * Platform/spi/ios/UIKitSPI.h:
124         - Define @class UIHoverEvent using header if available, else
125           fall back to local class definition.
126         - Define methods separately from class definition.
127         * UIProcess/ios/WKMouseGestureRecognizer.mm:
128         (-[WKMouseGestureRecognizer setView:]):
129         - Use new method if it is available.
130
131 2020-05-09  Commit Queue  <commit-queue@webkit.org>
132
133         Unreviewed, reverting r261389.
134         https://bugs.webkit.org/show_bug.cgi?id=211678
135
136         Introduced page loading regression. (Requested by perarne on
137         #webkit).
138
139         Reverted changeset:
140
141         "[iOS] Update message filtering rules in the WebContent
142         process' sandbox"
143         https://bugs.webkit.org/show_bug.cgi?id=211188
144         https://trac.webkit.org/changeset/261389
145
146 2020-05-09  David Kilzer  <ddkilzer@apple.com>
147
148         Adapt LocalCurrentGraphicsContext for iOS
149         <https://webkit.org/b/211660>
150
151         Reviewed by Darin Adler.
152
153         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
154         (WebKit::convertPlatformImageToBitmap):
155         - Use LocalCurrentGraphicsContext for both iOS and Mac code
156           paths.
157
158         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
159         - Switch from PLATFORM(MAC) and PLATFORM(IOS_FAMIY) to
160           USE(APPKIT) to separate platform code.
161         (WebKit::convertDragImageToBitmap):
162         (WebKit::convertImageToBitmap): Delete.
163         (WebKit::convertCGImageToBitmap): Delete.
164         - Combine Mac-specific convertImageToBitmap() and iOS-specific
165           convertCGImageToBitmap() into a single method using DragImage
166           type and special-casing one line of code.
167         (WebKit::WebDragClient::startDrag):
168         (WebKit::WebDragClient::didConcludeEditDrag):
169         - Combine iOS and Mac methods into a singe method.
170
171 2020-05-09  David Quesada  <david_quesada@apple.com>
172
173         Remove HAVE_UI_SCROLL_VIEW_INDICATOR_FLASHING_SPI
174         https://bugs.webkit.org/show_bug.cgi?id=211662
175         rdar://problem/63048713
176
177         Reviewed by Darin Adler.
178
179         Remove this platform conditional and unconditionally use -[UIScrolView _flashScrollIndicatorsForAxes:
180         persistingPreviousFlashes:]. All supported platforms with UIScrollView have this SPI, and the conditional
181         was excluding Mac Catalyst, making WKKeyboardScrollViewAnimator send a message to its scroll view that
182         is no longer implemented.
183
184         * Platform/spi/ios/UIKitSPI.h:
185             Remove the declaration of the now unused -_flashScrollIndicatorsPersistingPreviousFlashes:.
186         * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
187         (axesForDelta):
188         (-[WKKeyboardScrollViewAnimator scrollToContentOffset:animated:]):
189
190 2020-05-08  David Kilzer  <ddkilzer@apple.com>
191
192         Remove empty directories from from svn.webkit.org repository
193         <https://webkit.org/b/211644>
194
195         Reviewed by Darin Adler.
196
197         * UIProcess/API/win: Removed.
198
199 2020-05-08  Chris Dumez  <cdumez@apple.com>
200
201         Regression(r210945): No attachment when sharing to mail
202         https://bugs.webkit.org/show_bug.cgi?id=211651
203         <rdar://problem/63040170>
204
205         Reviewed by Tim Horton.
206
207         When failing to determine foreground state, the code before r210945 was assuming
208         'foreground', while the code in r210945 assume 'background'. This causes things
209         to not render properly when we fail to determine the foreground state.
210
211         This patch merely restores pre-r210945 behavior. I will investigate why we are
212         unable to determinate the host application PID for the MailCompositionService.
213
214         * UIProcess/ApplicationStateTracker.mm:
215         (WebKit::isApplicationForeground):
216
217 2020-05-08  Nikos Mouchtaris  <nmouchtaris@apple.com>
218
219         Implement web-share v2 for files
220         https://bugs.webkit.org/show_bug.cgi?id=209265
221
222         Reviewed by Andy Estes.
223
224         Added support for passing file objects over IPC and
225         sharing of files to share sheet.
226
227         * Shared/WebCoreArgumentCoders.cpp:
228         (IPC::ArgumentCoder<Vector<RawFile>>::encode):
229         (IPC::ArgumentCoder<Vector<RawFile>>::decode):
230         (IPC::ArgumentCoder<ShareDataWithParsedURL>::encode):
231         (IPC::ArgumentCoder<ShareDataWithParsedURL>::decode):
232         * Shared/WebCoreArgumentCoders.h:
233         * UIProcess/Cocoa/ShareableFileWrite.h: Added.
234         * UIProcess/Cocoa/ShareableFileWrite.mm: Added.
235         (+[WKShareableFileWrite getSharingDirectoryPath]):
236         (+[WKShareableFileWrite getFileDirectoryForSharing]):
237         (+[WKShareableFileWrite removeFileDirectoryForSharing]):
238         (+[WKShareableFileWrite setQuarantineInformationForFilePath:]):
239         (+[WKShareableFileWrite applyQuarantineSandboxAndDownloadFlagsToFileAtPath:]):
240         (+[WKShareableFileWrite createFilename:]):
241         (+[WKShareableFileWrite writeFileToShareableURL:data:]):
242         * UIProcess/Cocoa/WKShareSheet.mm:
243         (-[WKShareSheet presentWithParameters:inRect:completionHandler:]):
244         (-[WKShareSheet _didCompleteWithSuccess:]):
245         * WebKit.xcodeproj/project.pbxproj:
246
247 2020-05-08  Brent Fulgham  <bfulgham@apple.com>
248
249         Revise sandbox to stop logging some commonly-used properties 
250         https://bugs.webkit.org/show_bug.cgi?id=211636
251         <rdar://problem/63014244>
252
253         Reviewed by Per Arne Vollan.
254
255         Further living on and testing has shown a handful of sysctl entries that are in regular use, and do not need
256         to be logged or considered for removal. This patch has no change in behavior, just reduces logging.
257
258         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
259         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
260
261 2020-05-08  Chris Dumez  <cdumez@apple.com>
262
263         Make WKWebViewConfiguration._alwaysRunsAtForegroundPriority an alias for _clientNavigationsRunAtForegroundPriority
264         https://bugs.webkit.org/show_bug.cgi?id=211632
265
266         Reviewed by Darin Adler.
267
268         Make WKWebViewConfiguration._alwaysRunsAtForegroundPriority an alias for _clientNavigationsRunAtForegroundPriority.
269         _alwaysRunsAtForegroundPriority is a frequent source of process assertion leaks that get blamed on WebKit. Clients
270         are using this in order to be able to do loads in background views so _clientNavigationsRunAtForegroundPriority
271         should suffice and is not leak prone since the process assertion is released after the navigation has completed.
272
273         * UIProcess/API/APIPageConfiguration.cpp:
274         (API::PageConfiguration::copy const):
275         * UIProcess/API/APIPageConfiguration.h:
276         (API::PageConfiguration::alwaysRunsAtForegroundPriority const): Deleted.
277         (API::PageConfiguration::setAlwaysRunsAtForegroundPriority): Deleted.
278         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
279         (-[WKWebViewConfiguration _alwaysRunsAtForegroundPriority]):
280         (-[WKWebViewConfiguration _setAlwaysRunsAtForegroundPriority:]):
281         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
282         * UIProcess/WebPageProxy.cpp:
283         (WebKit::WebPageProxy::close):
284         (WebKit::WebPageProxy::updateThrottleState):
285         (WebKit::WebPageProxy::resetStateAfterProcessExited):
286         * UIProcess/WebPageProxy.h:
287
288 2020-05-08  Alex Christensen  <achristensen@webkit.org>
289
290         Revert r260390
291         https://bugs.webkit.org/show_bug.cgi?id=210759
292         <rdar://problem/62608140>
293
294         r260390 was intended to stop hitting some assertions in ~PendingFrameLoad, but it seems to have caused a regression.
295         Reverting it and removing the invalid assertions.
296
297         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
298         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::~PendingFrameLoad):
299         (WebKit::NetworkCache::SpeculativeLoadManager::~SpeculativeLoadManager):
300
301 2020-05-08  Wenson Hsieh  <wenson_hsieh@apple.com>
302
303         [iOS] caret appears in the middle of a search field when field is focused on agoda.com
304         https://bugs.webkit.org/show_bug.cgi?id=211591
305         <rdar://problem/60605873>
306
307         Reviewed by Antoine Quint.
308
309         The main search field on the mobile version of this website begins offscreen, with a CSS transform that moves it
310         to the far right; tapping the button element that (visually) has a search-field-like appearance on the front
311         page programmatically focuses the real offscreen search field, and animates it onscreen by changing the CSS
312         transform attribute to remove the x-axis translation.
313
314         On iOS, the caret rect is computed and sent to the UI process via editor state updates; however, the editor
315         state is computed immediately after focusing the input field. As such, the caret rect at this moment is computed
316         in the middle of the animation, leaving it stuck in an unpredictable location.
317
318         To fix this, add plumbing to call into the WebKit client layer when an animation has ended. On iOS, if the
319         selection is visible (i.e. a ranged selection, or editable caret), then check to see whether the element that
320         has finished animating contains either endpoint of the selection. If so, then schedule a followup editor state
321         update to push updated selection information to the UI process.
322
323         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
324         (WebKit::WebChromeClient::animationDidFinishForElement):
325         * WebProcess/WebCoreSupport/WebChromeClient.h:
326
327         Add a new client hook for when animations end.
328
329         * WebProcess/WebPage/WebPage.cpp:
330         (WebKit::WebPage::animationDidFinishForElement):
331         * WebProcess/WebPage/WebPage.h:
332         * WebProcess/WebPage/ios/WebPageIOS.mm:
333
334         Add logic to schedule a new editor state update if needed, after an animation ends that might affect either
335         the start or end of the selection.
336
337         (WebKit::WebPage::animationDidFinishForElement):
338
339 2020-05-08  David Kilzer  <ddkilzer@apple.com>
340
341         REGRESSION (r260228): Linker warning about limitsNavigationsToAppBoundDomains property overriding instance methods from class
342         <https://webkit.org/b/211393>
343
344         Reviewed by Brent Fulgham.
345
346         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
347         (-[WKWebViewConfiguration limitsNavigationsToAppBoundDomains]):
348         (-[WKWebViewConfiguration setLimitsNavigationsToAppBoundDomains:]):
349         - Move from WKPrivate category to main category to fix linker
350           warnings.
351
352 2020-05-08  Chris Dumez  <cdumez@apple.com>
353
354         REGRESSION(r259209) Webview's pending URL is null after restoring session state
355         https://bugs.webkit.org/show_bug.cgi?id=211626
356         <rdar://problem/62992262>
357
358         Reviewed by Alex Christensen.
359
360         The issue was that WebPageProxy::goToBackForwardItem() would behave differently whether
361         the page has a running process or not. In particular, when the page did not have a
362         running process, goToBackForwardItem() would return early and call launchProcessWithItem()
363         instead. Unlike goToBackForwardItem(), launchProcessWithItem() would fail to set the
364         pending API request.
365
366         To address the issue, I am getting rid of launchProcessWithItem() and merging its logic
367         into goToBackForwardItem() instead. Both methods shared a lot of code anyway and having
368         2 separate code paths that may diverge is error prone.
369
370         Change is covered by new API test.
371
372         * UIProcess/WebPageProxy.cpp:
373         (WebKit::WebPageProxy::goToBackForwardItem):
374         (WebKit::WebPageProxy::launchProcessWithItem): Deleted.
375         * UIProcess/WebPageProxy.h:
376
377 2020-05-08  Alex Christensen  <achristensen@webkit.org>
378
379         WKWebView.title should be safe browsing warning's title during a safe browsing warning
380         https://bugs.webkit.org/show_bug.cgi?id=211403
381
382         Reviewed by Tim Horton.
383
384         Add a new property to PageLoadState, which allows the title to be set underneath it.
385         That way, once the safe browsing warning is closed, we can update the title to what it would've been,
386         including any changes that happened while the warning was open.
387
388         Covered by an API test.  I also manually verified this fixes rdar://problem/56201982
389
390         * UIProcess/PageLoadState.cpp:
391         (WebKit::PageLoadState::commitChanges):
392         (WebKit::PageLoadState::reset):
393         (WebKit::PageLoadState::didCommitLoad):
394         (WebKit::PageLoadState::title const):
395         (WebKit::PageLoadState::setTitleFromSafeBrowsingWarning):
396         * UIProcess/PageLoadState.h:
397         * UIProcess/WebPageProxy.cpp:
398         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
399
400 2020-05-08  Per Arne Vollan  <pvollan@apple.com>
401
402         [iOS] Update message filtering rules in the WebContent process' sandbox
403         https://bugs.webkit.org/show_bug.cgi?id=211188
404
405         Reviewed by Brent Fulgham.
406
407         Based on telemetry and local testing, update the message filtering rules in the WebContent process' sandbox on iOS.
408         Messages that have not been observed being in use should be denied.
409
410         No new tests, covered by existing tests.
411
412         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
413
414 2020-05-08  Chris Dumez  <cdumez@apple.com>
415
416         Turn processDidBecomeUnresponsive logging into error logging
417         https://bugs.webkit.org/show_bug.cgi?id=211629
418
419         Reviewed by Youenn Fablet.
420
421         * UIProcess/WebPageProxy.cpp:
422         (WebKit::WebPageProxy::processDidBecomeUnresponsive):
423
424 2020-05-08  Per Arne Vollan  <pvollan@apple.com>
425
426         [Cocoa] Close connections to Launch Services after revoking extension
427         https://bugs.webkit.org/show_bug.cgi?id=211594
428
429         Reviewed by Brent Fulgham.
430
431         In <https://trac.webkit.org/changeset/258915/webkit>, connections to the Launch Services database mapping
432         services were denied, by creating a temporary extension. After revoking this extension in the WebContent
433         process, it is important to close any open connections to Launch Services initiated by the mapping.
434
435         No new tests, covered by existing UTI/MIME type tests.
436
437         * WebProcess/cocoa/WebProcessCocoa.mm:
438         (WebKit::WebProcess::platformInitializeWebProcess):
439
440 2020-05-08  Youenn Fablet  <youenn@apple.com>
441
442         Handle remote audio capture IPC messages in a background thread
443         https://bugs.webkit.org/show_bug.cgi?id=211583
444
445         Reviewed by Eric Carlson.
446
447         We introduce RemoteCaptureSampleManager which is responsible to get remote capture sample IPC messages and treat them from a background thread.
448         It is currently used to handle audio capture IPC messages.
449         We move UserMediaCaptureManager::Source in its own file and rename it to RemoteRealtimeMediaSource.
450
451         Covered by existing tests.
452
453         * DerivedSources-input.xcfilelist:
454         * DerivedSources-output.xcfilelist:
455         * DerivedSources.make:
456         * PlatformMac.cmake:
457         * SourcesCocoa.txt:
458         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
459         * WebKit.xcodeproj/project.pbxproj:
460         * WebProcess/cocoa/RemoteCaptureSampleManager.cpp: Added.
461         (WebKit::RemoteCaptureSampleManager::RemoteCaptureSampleManager):
462         (WebKit::RemoteCaptureSampleManager::~RemoteCaptureSampleManager):
463         (WebKit::RemoteCaptureSampleManager::setConnection):
464         (WebKit::RemoteCaptureSampleManager::addSource):
465         (WebKit::RemoteCaptureSampleManager::removeSource):
466         (WebKit::RemoteCaptureSampleManager::dispatchToThread):
467         (WebKit::RemoteCaptureSampleManager::storageChanged):
468         (WebKit::RemoteCaptureSampleManager::audioSamplesAvailable):
469         * WebProcess/cocoa/RemoteCaptureSampleManager.h: Added.
470         * WebProcess/cocoa/RemoteCaptureSampleManager.messages.in: Added.
471         * WebProcess/cocoa/RemoteRealtimeMediaSource.cpp: Added.
472         (WebKit::RemoteRealtimeMediaSource::RemoteRealtimeMediaSource):
473         (WebKit::RemoteRealtimeMediaSource::~RemoteRealtimeMediaSource):
474         (WebKit::RemoteRealtimeMediaSource::whenReady):
475         (WebKit::RemoteRealtimeMediaSource::didFail):
476         (WebKit::RemoteRealtimeMediaSource::setAsReady):
477         (WebKit::RemoteRealtimeMediaSource::clone):
478         (WebKit::RemoteRealtimeMediaSource::setCapabilities):
479         (WebKit::RemoteRealtimeMediaSource::setSettings):
480         (WebKit::RemoteRealtimeMediaSource::remoteAudioSamplesAvailable):
481         (WebKit::RemoteRealtimeMediaSource::remoteVideoSampleAvailable):
482         (WebKit::RemoteRealtimeMediaSource::connection):
483         (WebKit::RemoteRealtimeMediaSource::startProducingData):
484         (WebKit::RemoteRealtimeMediaSource::stopProducingData):
485         (WebKit::RemoteRealtimeMediaSource::setShouldApplyRotation):
486         (WebKit::RemoteRealtimeMediaSource::capabilities):
487         (WebKit::RemoteRealtimeMediaSource::applyConstraints):
488         (WebKit::RemoteRealtimeMediaSource::applyConstraintsSucceeded):
489         (WebKit::RemoteRealtimeMediaSource::applyConstraintsFailed):
490         (WebKit::RemoteRealtimeMediaSource::hasEnded):
491         (WebKit::RemoteRealtimeMediaSource::stopBeingObserved):
492         (WebKit::RemoteRealtimeMediaSource::requestToEnd):
493         * WebProcess/cocoa/RemoteRealtimeMediaSource.h: Added.
494         (WebKit::RemoteRealtimeMediaSource::identifier const):
495         (WebKit::RemoteRealtimeMediaSource::settings const):
496         (WebKit::RemoteRealtimeMediaSource::setShouldCaptureInGPUProcess):
497         (WebKit::RemoteRealtimeMediaSource::shouldCaptureInGPUProcess const):
498         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
499         (WebKit::UserMediaCaptureManager::createCaptureSource):
500         (WebKit::UserMediaCaptureManager::cloneSource):
501         (WebKit::UserMediaCaptureManager::cloneVideoSource):
502         (WebKit::UserMediaCaptureManager::AudioFactory::createAudioCaptureSource):
503         (WebKit::UserMediaCaptureManager::AudioFactory::setShouldCaptureInGPUProcess):
504         (WebKit::UserMediaCaptureManager::VideoFactory::createVideoCaptureSource):
505         (WebKit::UserMediaCaptureManager::DisplayFactory::createDisplayCaptureSource):
506         * WebProcess/cocoa/UserMediaCaptureManager.h:
507         * WebProcess/cocoa/UserMediaCaptureManager.messages.in:
508
509 2020-05-08  Youenn Fablet  <youenn@apple.com>
510
511         Video capture does not get unmuted in case of tab switch on iOS
512         https://bugs.webkit.org/show_bug.cgi?id=211509
513
514         Reviewed by Eric Carlson.
515
516         Remove no longer needed code.
517
518         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
519         (WebKit::UserMediaCaptureManager::VideoFactory::setActiveSource):
520         * WebProcess/cocoa/UserMediaCaptureManager.h:
521
522 2020-05-08  Carlos Garcia Campos  <cgarcia@igalia.com>
523
524         Unreviewed. Fix GTK4 build after r261370
525
526         * UIProcess/API/gtk/WebKitScriptDialogGtk.cpp:
527         (webkitScriptDialogIsUserHandled):
528
529 2020-05-08  Lauro Moura  <lmoura@igalia.com>
530
531         [WPE][WebDriver] Implement user prompt support
532         https://bugs.webkit.org/show_bug.cgi?id=207372
533
534         Reviewed by Carlos Garcia Campos.
535
536         Provide a default implementation for WebDriver dialog commands.
537         This implementation will mimic the expected browser behavior of
538         accepting/dismissing the dialogs, while not exposing any new API.
539
540         * UIProcess/API/glib/WebKitScriptDialogPrivate.h:
541         - Expose new private function to check whether the dialog is using a
542         default implementation or is handled by the user.
543         * UIProcess/API/glib/WebKitWebView.cpp:
544         - Avoid default WebDriver behavior if the dialog is user-handled.
545         (webkitWebViewSetCurrentScriptDialogUserInput):
546         (webkitWebViewAcceptCurrentScriptDialog):
547         (webkitWebViewDismissCurrentScriptDialog):
548         * UIProcess/API/gtk/WebKitScriptDialogGtk.cpp:
549         (webkitScriptDialogIsUserHandled):
550         - Return whether the dialog is user handled.
551         * UIProcess/API/wpe/WebKitScriptDialogWPE.cpp:
552         - Added basic behavior for the WebDriver dialog callbacks for WPE.
553         (webkitScriptDialogAccept):
554         (webkitScriptDialogDismiss):
555         (webkitScriptDialogSetUserInput):
556         (webkitScriptDialogIsUserHandled):
557
558         * UIProcess/API/wpe/WebKitWebViewWPE.cpp:
559         (webkitWebViewScriptDialog):
560         - Hold a dialog ref if the webview is controlled by automation and ends
561         up calling the default "script-dialog" event handler.
562
563 2020-05-07  Jiewen Tan  <jiewen_tan@apple.com>
564
565         [WebAuthn] Roll back newly created credentials if an error occurs
566         https://bugs.webkit.org/show_bug.cgi?id=183530
567         <rdar://problem/43357305>
568
569         Reviewed by Brent Fulgham.
570
571         We should clean up any newly created credentials if an error occurs before the relying party
572         registers the identity. Otherwise we are left with a dangling credential.
573
574         Covered by API tests.
575
576         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.h:
577         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
578         (WebKit::LocalAuthenticator::continueMakeCredentialAfterUserVerification):
579         (WebKit::LocalAuthenticator::continueGetAssertionAfterUserVerification):
580         (WebKit::LocalAuthenticator::receiveException const):
581
582 2020-05-07  Chris Dumez  <cdumez@apple.com>
583
584         Unreviewed, reverting r261252.
585
586         Reland r260684 now that a proper fix has landed in Reader
587
588         Reverted changeset:
589
590         "REGRESSION (r260684): Reader background is lost after
591         multitasking"
592         https://bugs.webkit.org/show_bug.cgi?id=211533
593         https://trac.webkit.org/changeset/261252
594
595 2020-05-07  Megan Gardner  <megan_gardner@apple.com>
596
597         Build Fix for MacCatalyst
598         https://bugs.webkit.org/show_bug.cgi?id=211601
599
600         Reviewed by Tim Horton.
601
602         * UIProcess/ios/WKContentViewInteraction.mm:
603         (-[WKContentView _removeContextMenuViewIfPossible]):
604
605 2020-05-07  Chris Dumez  <cdumez@apple.com>
606
607         Crash under WebKit::XPCServiceMain
608         https://bugs.webkit.org/show_bug.cgi?id=211600
609         <rdar://problem/62875458>
610
611         Reviewed by Darin Adler.
612
613         Made the following changes:
614         - Crash under strcmp() could in theory happen if expectedBundleVersion.UTF8String was null, which could
615           happen if expectedBundleVersion was null. I now use higher level String types for the versions, make
616           sure they are not null and use String comparison to compare them.
617         - Call CRASH() instead of __builtin_trap(), to guarantee that we crash with a SIGTRAP (see comment next
618           to CRASH() macro).
619         - Move CRASH() call to a crashDueWebKitFrameworkVersionMismatch() never inlined function to make it
620           clear when it crashes due to a framework version mismatch and distinguish from proper crashes.
621
622         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
623         (WebKit::crashDueWebKitFrameworkVersionMismatch):
624         (WebKit::XPCServiceMain):
625
626 2020-05-07  Youenn Fablet  <youenn@apple.com>
627
628         Remove AudioMediaStreamTrackRenderer::muted
629         https://bugs.webkit.org/show_bug.cgi?id=211289
630
631         Reviewed by Eric Carlson.
632
633         muted is unnecessary since we are using start/stop instead.
634
635         * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer.cpp:
636         * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer.h:
637         * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer.messages.in:
638         * WebProcess/GPU/webrtc/AudioMediaStreamTrackRenderer.cpp:
639         * WebProcess/GPU/webrtc/AudioMediaStreamTrackRenderer.h:
640
641 2020-05-07  Don Olmstead  <don.olmstead@sony.com>
642
643         Remove unused USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
644         https://bugs.webkit.org/show_bug.cgi?id=211582
645
646         Reviewed by Fujii Hironori.
647
648         After r261264 all ports implemented USE_REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR.
649
650         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
651         (WebKit::ThreadedCompositor::ThreadedCompositor):
652         (WebKit::m_displayRefreshMonitor):
653         (WebKit::ThreadedCompositor::invalidate):
654         (WebKit::ThreadedCompositor::sceneUpdateFinished):
655         (WebKit::ThreadedCompositor::displayRefreshMonitor):
656         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
657         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
658         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.h:
659         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
660         (WebKit::WebChromeClient::createDisplayRefreshMonitor const):
661         * WebProcess/WebCoreSupport/WebChromeClient.h:
662         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
663         (WebKit::DrawingAreaCoordinatedGraphics::createDisplayRefreshMonitor):
664         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h:
665         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
666         (WebKit::LayerTreeHost::createDisplayRefreshMonitor):
667         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h:
668         (WebKit::LayerTreeHost::deviceOrPageScaleFactorChanged):
669         * WebProcess/WebPage/DrawingArea.cpp:
670         * WebProcess/WebPage/DrawingArea.h:
671         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.h:
672         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm:
673         * WebProcess/WebPage/mac/DrawingAreaMac.cpp:
674
675 2020-05-07  Darin Adler  <darin@apple.com>
676
677         Add some missing null checks for DocumentLoader
678         https://bugs.webkit.org/show_bug.cgi?id=211544
679         rdar://62843516
680
681         Reviewed by Anders Carlsson.
682
683         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
684         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
685         Add a null check before calling DocumentLoader::response.
686
687 2020-05-07  Darin Adler  <darin@apple.com>
688
689         Remove USE(INSERTION_UNDO_GROUPING) checks in macOS platform code
690         https://bugs.webkit.org/show_bug.cgi?id=211525
691
692         Reviewed by Anders Carlsson.
693
694         * UIProcess/Cocoa/WebViewImpl.mm: Use NSTextInputContextSPI.h.
695         (WebKit::WebViewImpl::validAttributesForMarkedText): Removed
696         USE(INSERTION_UNDO_GROUPING) from the macOS-specific code here.
697         (WebKit::WebViewImpl::insertText): Ditto.
698         * UIProcess/PageClient.h: Ditto.
699         * UIProcess/ios/PageClientImplIOS.mm:
700         (WebKit::PageClientImpl::registerInsertionUndoGrouping): Deleted.
701         This function is not needed at all on iOS.
702         * UIProcess/mac/PageClientImplMac.h: Removed USE(INSERTION_UNDO_GROUPING).
703         * UIProcess/mac/PageClientImplMac.mm:
704         (WebKit::PageClientImpl::registerInsertionUndoGrouping): Ditto.
705
706 2020-05-07  Chris Dumez  <cdumez@apple.com>
707
708         Drop dead platformPrepareToSuspend / platformProcessDidResume in NetworkProcess
709         https://bugs.webkit.org/show_bug.cgi?id=211579
710
711         Reviewed by Geoffrey Garen.
712
713         * NetworkProcess/NetworkProcess.cpp:
714         (WebKit::NetworkProcess::prepareToSuspend):
715         (WebKit::NetworkProcess::resume):
716         * NetworkProcess/NetworkProcess.h:
717         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
718         (WebKit::NetworkProcess::platformPrepareToSuspend): Deleted.
719         (WebKit::NetworkProcess::platformProcessDidResume): Deleted.
720         * NetworkProcess/curl/NetworkProcessCurl.cpp:
721         (WebKit::NetworkProcess::platformPrepareToSuspend): Deleted.
722         (WebKit::NetworkProcess::platformProcessDidResume): Deleted.
723         * NetworkProcess/soup/NetworkProcessSoup.cpp:
724         (WebKit::NetworkProcess::platformPrepareToSuspend): Deleted.
725         (WebKit::NetworkProcess::platformProcessDidResume): Deleted.
726
727 2020-05-07  Megan Gardner  <megan_gardner@apple.com>
728
729         ContextMenu: entire webpage pops and disappears to generate preview of embedded image
730         https://bugs.webkit.org/show_bug.cgi?id=211272
731         <rdar://problem/62482013>
732
733         Reviewed by Tim Horton.
734
735         The ActionSheetAssistant is always around, so using the presence of one
736         to determine if we need to remove the _contextMenuHintContainerView is incorrect
737         and causes it to be around on the next invocation of the context menu, and 
738         causing the failure of the creation of a new preview, which then will default to
739         popping the whole page. We need to ask the ActionSheetAssistant if it is actively showing
740         anything, and then correctly clean up the _contextMenuHintContainerView after the 
741         end of the interactions for FileUploadMenu and ActionSheetAssistant are done with their
742         interactions. 
743
744         * UIProcess/ios/WKActionSheetAssistant.h:
745         * UIProcess/ios/WKActionSheetAssistant.mm:
746         (-[WKActionSheetAssistant removeContextMenuInteraction]):
747         (-[WKActionSheetAssistant hasContextMenuInteraction]):
748         * UIProcess/ios/WKContentViewInteraction.h:
749         * UIProcess/ios/WKContentViewInteraction.mm:
750         (-[WKContentView removeContextMenuViewIfPossibleForActionSheetAssistant:]):
751         (-[WKContentView _canRemoveContextMenuView]):
752         (-[WKContentView _removeContextMenuViewIfPossible]):
753         (-[WKContentView contextMenuInteraction:willEndForConfiguration:animator:]):
754         * UIProcess/ios/forms/WKFileUploadPanel.mm:
755         (-[WKFileUploadPanel removeContextMenuInteraction]):
756
757 2020-05-07  Chris Dumez  <cdumez@apple.com>
758
759         Simplify several IPC sending call sites in the UIProcess
760         https://bugs.webkit.org/show_bug.cgi?id=211575
761
762         Reviewed by Alex Christensen.
763
764         Simplify several IPC sending call sites in the UIProcess by leveraging the fact
765         that WebPageProxy subclasses IPC::MessageSender.
766
767         * UIProcess/Cocoa/TextCheckingController.mm:
768         (WebKit::TextCheckingController::replaceRelativeToSelection):
769         (WebKit::TextCheckingController::removeAnnotationRelativeToSelection):
770         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
771         (WebKit::WebPageProxy::performDictionaryLookupAtLocation):
772         (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection):
773         (WebKit::WebPageProxy::insertDictatedTextAsync):
774         (WebKit::WebPageProxy::speakingErrorOccurred):
775         (WebKit::WebPageProxy::boundaryEventOccurred):
776         (WebKit::WebPageProxy::voicesDidChange):
777         * UIProcess/GeolocationPermissionRequestManagerProxy.cpp:
778         (WebKit::GeolocationPermissionRequestManagerProxy::didReceiveGeolocationPermissionDecision):
779         * UIProcess/Inspector/RemoteWebInspectorProxy.cpp:
780         (WebKit::RemoteWebInspectorProxy::setDiagnosticLoggingAvailable):
781         * UIProcess/Inspector/WebInspectorProxy.cpp:
782         (WebKit::WebInspectorProxy::setDiagnosticLoggingAvailable):
783         * UIProcess/Inspector/gtk/RemoteWebInspectorProxyGtk.cpp:
784         (WebKit::remoteFileReplaceContentsCallback):
785         * UIProcess/Inspector/gtk/WebInspectorProxyGtk.cpp:
786         (WebKit::fileReplaceContentsCallback):
787         * UIProcess/Inspector/mac/RemoteWebInspectorProxyMac.mm:
788         (WebKit::RemoteWebInspectorProxy::platformSave):
789         (WebKit::RemoteWebInspectorProxy::platformAppend):
790         * UIProcess/Inspector/mac/WebInspectorProxyMac.mm:
791         (WebKit::WebInspectorProxy::platformSave):
792         (WebKit::WebInspectorProxy::platformAppend):
793         * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp:
794         (WebKit::NotificationPermissionRequestManagerProxy::createRequest):
795         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
796         (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
797         (WebKit::UserMediaPermissionRequestManagerProxy::denyRequest):
798         * UIProcess/WebFrameProxy.cpp:
799         (WebKit::WebFrameProxy::collapseSelection):
800         * UIProcess/WebFullScreenManagerProxy.cpp:
801         (WebKit::WebFullScreenManagerProxy::willEnterFullScreen):
802         (WebKit::WebFullScreenManagerProxy::didEnterFullScreen):
803         (WebKit::WebFullScreenManagerProxy::willExitFullScreen):
804         (WebKit::WebFullScreenManagerProxy::didExitFullScreen):
805         (WebKit::WebFullScreenManagerProxy::setAnimatingFullScreen):
806         (WebKit::WebFullScreenManagerProxy::requestExitFullScreen):
807         (WebKit::WebFullScreenManagerProxy::saveScrollPosition):
808         (WebKit::WebFullScreenManagerProxy::restoreScrollPosition):
809         (WebKit::WebFullScreenManagerProxy::setFullscreenInsets):
810         (WebKit::WebFullScreenManagerProxy::setFullscreenAutoHideDuration):
811         (WebKit::WebFullScreenManagerProxy::setFullscreenControlsHidden):
812         * UIProcess/gtk/WebPageProxyGtk.cpp:
813         (WebKit::WebPageProxy::getCenterForZoomGesture):
814         * UIProcess/ios/SmartMagnificationController.mm:
815         (WebKit::SmartMagnificationController::handleSmartMagnificationGesture):
816         * UIProcess/ios/WKContentViewInteraction.mm:
817         (-[WKContentView ensurePositionInformationIsUpToDate:]):
818         * UIProcess/ios/WebPageProxyIOS.mm:
819         (WebKit::WebPageProxy::handleTwoFingerTapAtPoint):
820         (WebKit::WebPageProxy::handleStylusSingleTapAtPoint):
821         (WebKit::WebPageProxy::registerUIProcessAccessibilityTokens):
822         (WebKit::WebPageProxy::willStartUserTriggeredZooming):
823         (WebKit::WebPageProxy::potentialTapAtPosition):
824         (WebKit::WebPageProxy::commitPotentialTap):
825         (WebKit::WebPageProxy::cancelPotentialTap):
826         (WebKit::WebPageProxy::tapHighlightAtPosition):
827         (WebKit::WebPageProxy::handleTap):
828         (WebKit::WebPageProxy::didRecognizeLongPress):
829         (WebKit::WebPageProxy::handleDoubleTapForDoubleClickAtPoint):
830         (WebKit::WebPageProxy::inspectorNodeSearchMovedToPosition):
831         (WebKit::WebPageProxy::inspectorNodeSearchEndedAtPosition):
832         (WebKit::WebPageProxy::blurFocusedElement):
833         (WebKit::WebPageProxy::setIsShowingInputViewForFocusedElement):
834         (WebKit::WebPageProxy::setFocusedElementValue):
835         (WebKit::WebPageProxy::setFocusedElementValueAsNumber):
836         (WebKit::WebPageProxy::setFocusedElementSelectedIndex):
837         (WebKit::WebPageProxy::computePagesForPrintingAndDrawToPDF):
838         (WebKit::WebPageProxy::contentSizeCategoryDidChange):
839         (WebKit::WebPageProxy::generateSyntheticEditingCommand):
840         * UIProcess/mac/ViewGestureControllerMac.mm:
841         (WebKit::ViewGestureController::handleMagnificationGestureEvent):
842         (WebKit::ViewGestureController::handleSmartMagnificationGesture):
843         * UIProcess/mac/WebPageProxyMac.mm:
844         (WebKit::WebPageProxy::windowAndViewFramesChanged):
845         (WebKit::WebPageProxy::setMainFrameIsScrollable):
846         (WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync):
847         (WebKit::WebPageProxy::fontAtSelection):
848         (WebKit::WebPageProxy::stringSelectionForPasteboard):
849         (WebKit::WebPageProxy::dataSelectionForPasteboard):
850         (WebKit::WebPageProxy::readSelectionFromPasteboard):
851         (WebKit::WebPageProxy::replaceSelectionWithPasteboardData):
852         (WebKit::WebPageProxy::sendComplexTextInputToPlugin):
853         (WebKit::WebPageProxy::uppercaseWord):
854         (WebKit::WebPageProxy::lowercaseWord):
855         (WebKit::WebPageProxy::capitalizeWord):
856         (WebKit::WebPageProxy::setSmartInsertDeleteEnabled):
857         (WebKit::WebPageProxy::registerUIProcessAccessibilityTokens):
858         (WebKit::WebPageProxy::shouldDelayWindowOrderingForEvent):
859         (WebKit::WebPageProxy::acceptsFirstMouse):
860
861 2020-05-07  Commit Queue  <commit-queue@webkit.org>
862
863         Unreviewed, reverting r260769.
864         https://bugs.webkit.org/show_bug.cgi?id=211578
865
866         Introduced regressions related to sharing (Requested by
867         perarne on #webkit).
868
869         Reverted changeset:
870
871         "[Cocoa] After r258891, r255119 can be reverted"
872         https://bugs.webkit.org/show_bug.cgi?id=211083
873         https://trac.webkit.org/changeset/260769
874
875 2020-05-07  Chris Dumez  <cdumez@apple.com>
876
877         [iOS] AuxiliaryProcessProxy::sendWithAsyncReply() should prevent auxiliary process suspension while processing the IPC
878         https://bugs.webkit.org/show_bug.cgi?id=209928
879
880         Reviewed by Youenn Fablet.
881
882         AuxiliaryProcessProxy::sendWithAsyncReply() should prevent auxiliary process suspension
883         on iOS while processing the IPC. If the process is suspended either before or during
884         the IPC, this could result in hangs. This is a speculative fix for the flaky timeouts
885         we see on many tests on iOS only. We know that missing activities with
886         sendWithAsyncReply has caused test timeouts in the past (Bug 211421).
887
888         * UIProcess/AuxiliaryProcessProxy.cpp:
889         (WebKit::AuxiliaryProcessProxy::sendMessage):
890         * UIProcess/AuxiliaryProcessProxy.h:
891         (WebKit::AuxiliaryProcessProxy::sendWithAsyncReply):
892         * UIProcess/GPU/GPUProcessProxy.cpp:
893         (WebKit::GPUProcessProxy::getGPUProcessConnection):
894         * UIProcess/GPU/GPUProcessProxy.h:
895         * UIProcess/Network/NetworkProcessProxy.cpp:
896         (WebKit::NetworkProcessProxy::getNetworkProcessConnection):
897         (WebKit::NetworkProcessProxy::setUseITPDatabase):
898         (WebKit::NetworkProcessProxy::resetCacheMaxAgeCapForPrevalentResources):
899         (WebKit::NetworkProcessProxy::resetParametersToDefaultValues):
900         (WebKit::NetworkProcessProxy::scheduleClearInMemoryAndPersistent):
901         (WebKit::NetworkProcessProxy::resetCrossSiteLoadsWithLinkDecorationForTesting):
902         (WebKit::NetworkProcessProxy::setAppBoundDomainsForResourceLoadStatistics):
903         (WebKit::NetworkProcessProxy::setShouldDowngradeReferrerForTesting):
904         (WebKit::NetworkProcessProxy::setThirdPartyCookieBlockingMode):
905         (WebKit::NetworkProcessProxy::setShouldEnbleSameSiteStrictEnforcementForTesting):
906         (WebKit::NetworkProcessProxy::setFirstPartyWebsiteDataRemovalModeForTesting):
907         (WebKit::NetworkProcessProxy::sendPrepareToSuspend):
908         * UIProcess/Network/NetworkProcessProxy.h:
909         * UIProcess/Plugins/PluginProcessProxy.cpp:
910         (WebKit::PluginProcessProxy::PluginProcessProxy):
911         * UIProcess/Plugins/PluginProcessProxy.h:
912         * UIProcess/ProcessThrottler.h:
913         (WebKit::ProcessThrottler::Activity::Activity):
914         (WebKit::ProcessThrottler::Activity::isQuietActivity const):
915         (WebKit::ProcessThrottler::Activity::invalidate):
916         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
917         (WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest):
918         * UIProcess/WebBackForwardCacheEntry.cpp:
919         (WebKit::WebBackForwardCacheEntry::~WebBackForwardCacheEntry):
920         * UIProcess/WebCookieManagerProxy.cpp:
921         (WebKit::WebCookieManagerProxy::getHostnamesWithCookies):
922         (WebKit::WebCookieManagerProxy::deleteCookie):
923         (WebKit::WebCookieManagerProxy::deleteAllCookiesModifiedSince):
924         (WebKit::WebCookieManagerProxy::setCookies):
925         (WebKit::WebCookieManagerProxy::getAllCookies):
926         (WebKit::WebCookieManagerProxy::getCookies):
927         (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):
928         (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):
929         * UIProcess/WebPageProxy.cpp:
930         (WebKit::WebPageProxy::getProcessDisplayName):
931         * UIProcess/WebProcessProxy.cpp:
932         (WebKit::WebProcessProxy::setThirdPartyCookieBlockingMode):
933         (WebKit::WebProcessProxy::fetchWebsiteData):
934         (WebKit::WebProcessProxy::deleteWebsiteData):
935         (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
936         (WebKit::WebProcessProxy::sendPrepareToSuspend):
937         (WebKit::WebProcessProxy::activePagesDomainsForTesting):
938         (WebKit::WebProcessProxy::establishServiceWorkerContext):
939         * UIProcess/WebProcessProxy.h:
940         * UIProcess/ios/WebPageProxyIOS.mm:
941         (WebKit::WebPageProxy::insertTextPlaceholder):
942         (WebKit::WebPageProxy::removeTextPlaceholder):
943         (WebKit::WebPageProxy::requestAutocorrectionData):
944         (WebKit::WebPageProxy::requestEvasionRectsAboveSelection):
945         (WebKit::WebPageProxy::updateSelectionWithDelta):
946         (WebKit::WebPageProxy::requestDocumentEditingContext):
947         (WebKit::WebPageProxy::insertDroppedImagePlaceholders):
948
949 2020-05-07  Carlos Garcia Campos  <cgarcia@igalia.com>
950
951         [GTK] REGRESSION(r260996): Pressing <Tab> in an HTTP authentication dialog makes the dialog lose focus
952         https://bugs.webkit.org/show_bug.cgi?id=211555
953
954         Reviewed by Philippe Normand.
955
956         Bring back webkitWebViewBaseFocus to GTK3. I made it GTK4 only by mistake in r260996.
957
958         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
959         (webkitWebViewBaseFocus):
960         (webkit_web_view_base_class_init):
961
962 2020-05-07  Philippe Normand  <pnormand@igalia.com>
963
964         [GTK] Build warning fixes
965
966         Rubber-stamped by Žan Doberšek.
967
968         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
969         (webkitWebViewBaseGrabFocus):
970         * UIProcess/GPU/GPUProcessProxy.cpp:
971         (WebKit::GPUProcessProxy::getGPUProcessConnection):
972         * UIProcess/Network/NetworkProcessProxy.cpp:
973         (WebKit::NetworkProcessProxy::getNetworkProcessConnection):
974
975 2020-05-07  Youenn Fablet  <youenn@apple.com>
976
977         Sending WebRTC network packets should not go through the main thread
978         https://bugs.webkit.org/show_bug.cgi?id=211291
979
980         Reviewed by Eric Carlson.
981
982         Following on receiving RTC packets from a background thread, we also send RTC packets from a background thread.
983         Creation of the sockets also happens in a background thread.
984         LibWebRTCNetwork is getting the connection whenever a new connection to network process is created.
985         It will then hop to the RTC network thread to set the IPC connection to the libwebrtc socket factory.
986
987         At creation of the socket, we get the IPC connection to the network process and keep a ref in the RTC socket.
988         In case network process crashed and the IPC connection of the RTC network is null, we hop to the main thread to create a new IPC connection.
989         This will fail the creation of the socket (as well as new ones as well) as long as the IPC connection to network process is not valid again.
990
991         Covered by existing tests.
992
993         * WebProcess/Network/webrtc/LibWebRTCNetwork.cpp:
994         (WebKit::LibWebRTCNetwork::setAsActive):
995         (WebKit::LibWebRTCNetwork::setConnection):
996         (WebKit::LibWebRTCNetwork::dispatchToThread):
997         * WebProcess/Network/webrtc/LibWebRTCNetwork.h:
998         (WebKit::LibWebRTCNetwork::connection):
999         (WebKit::LibWebRTCNetwork::isActive const):
1000         * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
1001         (WebKit::LibWebRTCProvider::startedNetworkThread):
1002         * WebProcess/Network/webrtc/LibWebRTCProvider.h:
1003         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
1004         (WebKit::LibWebRTCSocket::SendTo):
1005         (WebKit::LibWebRTCSocket::Close):
1006         (WebKit::LibWebRTCSocket::SetOption):
1007         (WebKit::LibWebRTCSocket::suspend):
1008         * WebProcess/Network/webrtc/LibWebRTCSocket.h:
1009         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
1010         (WebKit::LibWebRTCSocketFactory::setConnection):
1011         (WebKit::LibWebRTCSocketFactory::connection):
1012         (WebKit::LibWebRTCSocketFactory::createServerTcpSocket):
1013         (WebKit::LibWebRTCSocketFactory::createUdpSocket):
1014         (WebKit::LibWebRTCSocketFactory::createClientTcpSocket):
1015         (WebKit::LibWebRTCSocketFactory::createNewConnectionSocket):
1016         (WebKit::LibWebRTCSocketFactory::addSocket):
1017         (WebKit::LibWebRTCSocketFactory::removeSocket):
1018         (WebKit::LibWebRTCSocketFactory::forSocketInGroup):
1019         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.h:
1020
1021 2020-05-07  Adrian Perez de Castro  <aperez@igalia.com>
1022
1023         [GTK4] Stop using the GtkWidget.destroy vfunc
1024         https://bugs.webkit.org/show_bug.cgi?id=211553
1025
1026         Reviewed by Carlos Garcia Campos.
1027
1028         No new tests needed.
1029
1030         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1031         (webkitWebViewBaseDestroy): Removed.
1032         (webkitWebViewBaseDispose): Bring in the code from the removed function, adapt
1033         to use g_clear_pointer() to destroy the nested dialog.
1034         (webkit_web_view_base_class_init): Do not set the GtkWidget.destroy vfunc.
1035
1036 2020-05-07  Philippe Normand  <pnormand@igalia.com>
1037
1038         [WPE][Qt] Enable by default
1039         https://bugs.webkit.org/show_bug.cgi?id=211517
1040
1041         Reviewed by Adrian Perez de Castro.
1042
1043         * PlatformWPE.cmake: Fix WPEQt build.
1044
1045
1046 2020-05-06  Alex Christensen  <achristensen@webkit.org>
1047
1048         Fix webkitpy tests after r261254
1049         https://bugs.webkit.org/show_bug.cgi?id=211112
1050
1051         test.messages.in was accidentally deleted instead of moved, and messages_unittest.py needed to be told of the new locations of results.
1052         The rest is just running the generator to update results.
1053
1054         * Scripts/MessageNames.cpp:
1055         (IPC::description):
1056         (IPC::receiverName):
1057         (IPC::isValidMessageName):
1058         * Scripts/MessageNames.h:
1059         * Scripts/testMessageReceiver.cpp:
1060         (Messages::WebPage::GetPluginProcessConnection::send):
1061         (Messages::WebPage::TestMultipleAttributes::send):
1062         (WebKit::WebPage::didReceiveMessage):
1063         (WebKit::WebPage::didReceiveSyncMessage):
1064         * Scripts/testMessages.h:
1065         (Messages::WebPage::messageReceiverName):
1066         (Messages::WebPage::LoadURL::name):
1067         (Messages::WebPage::LoadURL::LoadURL):
1068         (Messages::WebPage::LoadURL::arguments const):
1069         (Messages::WebPage::LoadSomething::name):
1070         (Messages::WebPage::LoadSomething::LoadSomething):
1071         (Messages::WebPage::LoadSomething::arguments const):
1072         (Messages::WebPage::TouchEvent::name):
1073         (Messages::WebPage::TouchEvent::TouchEvent):
1074         (Messages::WebPage::TouchEvent::arguments const):
1075         (Messages::WebPage::AddEvent::name):
1076         (Messages::WebPage::AddEvent::AddEvent):
1077         (Messages::WebPage::AddEvent::arguments const):
1078         (Messages::WebPage::LoadSomethingElse::name):
1079         (Messages::WebPage::LoadSomethingElse::LoadSomethingElse):
1080         (Messages::WebPage::LoadSomethingElse::arguments const):
1081         (Messages::WebPage::DidReceivePolicyDecision::name):
1082         (Messages::WebPage::DidReceivePolicyDecision::DidReceivePolicyDecision):
1083         (Messages::WebPage::DidReceivePolicyDecision::arguments const):
1084         (Messages::WebPage::Close::name):
1085         (Messages::WebPage::Close::arguments const):
1086         (Messages::WebPage::PreferencesDidChange::name):
1087         (Messages::WebPage::PreferencesDidChange::PreferencesDidChange):
1088         (Messages::WebPage::PreferencesDidChange::arguments const):
1089         (Messages::WebPage::SendDoubleAndFloat::name):
1090         (Messages::WebPage::SendDoubleAndFloat::SendDoubleAndFloat):
1091         (Messages::WebPage::SendDoubleAndFloat::arguments const):
1092         (Messages::WebPage::SendInts::name):
1093         (Messages::WebPage::SendInts::SendInts):
1094         (Messages::WebPage::SendInts::arguments const):
1095         (Messages::WebPage::CreatePlugin::name):
1096         (Messages::WebPage::CreatePlugin::CreatePlugin):
1097         (Messages::WebPage::CreatePlugin::arguments const):
1098         (Messages::WebPage::RunJavaScriptAlert::name):
1099         (Messages::WebPage::RunJavaScriptAlert::RunJavaScriptAlert):
1100         (Messages::WebPage::RunJavaScriptAlert::arguments const):
1101         (Messages::WebPage::GetPlugins::name):
1102         (Messages::WebPage::GetPlugins::GetPlugins):
1103         (Messages::WebPage::GetPlugins::arguments const):
1104         (Messages::WebPage::GetPluginProcessConnection::name):
1105         (Messages::WebPage::GetPluginProcessConnection::GetPluginProcessConnection):
1106         (Messages::WebPage::GetPluginProcessConnection::arguments const):
1107         (Messages::WebPage::TestMultipleAttributes::name):
1108         (Messages::WebPage::TestMultipleAttributes::arguments const):
1109         (Messages::WebPage::TestParameterAttributes::name):
1110         (Messages::WebPage::TestParameterAttributes::TestParameterAttributes):
1111         (Messages::WebPage::TestParameterAttributes::arguments const):
1112         (Messages::WebPage::TemplateTest::name):
1113         (Messages::WebPage::TemplateTest::TemplateTest):
1114         (Messages::WebPage::TemplateTest::arguments const):
1115         (Messages::WebPage::SetVideoLayerID::name):
1116         (Messages::WebPage::SetVideoLayerID::SetVideoLayerID):
1117         (Messages::WebPage::SetVideoLayerID::arguments const):
1118         (Messages::WebPage::DidCreateWebProcessConnection::name):
1119         (Messages::WebPage::DidCreateWebProcessConnection::DidCreateWebProcessConnection):
1120         (Messages::WebPage::DidCreateWebProcessConnection::arguments const):
1121         (Messages::WebPage::InterpretKeyEvent::name):
1122         (Messages::WebPage::InterpretKeyEvent::InterpretKeyEvent):
1123         (Messages::WebPage::InterpretKeyEvent::arguments const):
1124         (Messages::WebPage::DeprecatedOperation::name):
1125         (Messages::WebPage::DeprecatedOperation::DeprecatedOperation):
1126         (Messages::WebPage::DeprecatedOperation::arguments const):
1127         (Messages::WebPage::ExperimentalOperation::name):
1128         (Messages::WebPage::ExperimentalOperation::ExperimentalOperation):
1129         (Messages::WebPage::ExperimentalOperation::arguments const):
1130         (Messages::None::messageReceiverName): Deleted.
1131         * Scripts/testMessagesReplies.h:
1132         * Scripts/webkit/messages_unittest.py:
1133         * Scripts/webkit/test.messages.in: Added.
1134
1135 2020-05-06  Megan Gardner  <megan_gardner@apple.com>
1136
1137         Context Menus presented from the wrong location when presented from sub-frames
1138         https://bugs.webkit.org/show_bug.cgi?id=211537
1139         <rdar://problem/60390846>
1140
1141         Reviewed by Tim Horton.
1142
1143         The calculation for bounds for selection Information did not take frames into account,
1144         so if a frame was used, the location would not be correct in the context of the whole
1145         page, so the presentation location ended up being way off.
1146
1147         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1148         (-[WKFileUploadPanel showDocumentPickerMenu]):
1149         * WebProcess/WebPage/ios/WebPageIOS.mm:
1150         (WebKit::boundsPositionInformation):
1151         (WebKit::selectionPositionInformation):
1152
1153 2020-05-06  Commit Queue  <commit-queue@webkit.org>
1154
1155         Unreviewed, reverting r260689.
1156         https://bugs.webkit.org/show_bug.cgi?id=211542
1157
1158         "Caused regressions deleting text and filling password fields"
1159         (Requested by ddkilzer on #webkit).
1160
1161         Reverted changeset:
1162
1163         "WebPasteboardProxy::getPasteboardStringsForType() and
1164         WebPasteboardProxy::readURLFromPasteboard() should check
1165         return value of SharedMemory::createHandle()"
1166         https://bugs.webkit.org/show_bug.cgi?id=211002
1167         https://trac.webkit.org/changeset/260689
1168
1169 2020-05-06  Zalan Bujtas  <zalan@apple.com>
1170
1171         [ContentObservation] Shutterstock search bar is not activated on the first tap
1172         https://bugs.webkit.org/show_bug.cgi?id=211529
1173         <rdar://problem/58843932>
1174
1175         Reviewed by Simon Fraser.
1176
1177         Shutterstock has a “initial click” action which converts some “actionable” elements (<a>) to some other “actionable” elements (<button>).
1178         If this initial click also happens to be on an element that triggers content observation (input), we see those changes as actionable content and not proceed with the click event (stay at hover).
1179         Any subsequent click works as expected.
1180         It’s very difficult to eliminate such false positives since all we see is that some "actionable" content is going away while some "actionable" content is being created.
1181         This quirk ensures that the first tap on the page does not trigger content observation. (It also means that any hover menu gets submitted on the first tap, but apparently
1182         the Shutterstock top menu bar works fine with click events.)
1183
1184         * WebProcess/WebPage/WebPage.cpp:
1185         (WebKit::WebPage::didStartPageTransition):
1186         * WebProcess/WebPage/WebPage.h:
1187         * WebProcess/WebPage/ios/WebPageIOS.mm:
1188         (WebKit::WebPage::handleSyntheticClick):
1189
1190 2020-05-06  Wenson Hsieh  <wenson_hsieh@apple.com>
1191
1192         Use CocoaColor in more places instead of platform defines
1193         https://bugs.webkit.org/show_bug.cgi?id=211527
1194
1195         Reviewed by Darin Adler and Tim Horton.
1196
1197         Use CocoaColor (added in r261247) in more places, and also introduce `CocoaFont.h` and use it to simplify some
1198         existing code that uses platform ifdefs for UIFont, NSFont, UIFontDescriptor and NSFontDescriptor.
1199
1200         No change in behavior.
1201
1202         * Platform/cocoa/CocoaColor.h:
1203         * Platform/cocoa/CocoaFont.h: Copied from Source/WebKit/Platform/cocoa/CocoaColor.h.
1204         * Platform/cocoa/CocoaImage.h:
1205
1206         Change `@class`es to `OBJC_CLASS`, so that this header can be safely imported in C++ code.
1207
1208         * Shared/Cocoa/ArgumentCodersCocoa.mm:
1209         (IPC::typeFromObject):
1210         (IPC::isSerializableValue):
1211         (IPC::encodeFontInternal):
1212         (IPC::encodeObject):
1213         (IPC::platformColorClass): Deleted.
1214         (IPC::platformFontClass): Deleted.
1215         * Shared/Cocoa/CoreTextHelpers.h:
1216         * Shared/Cocoa/CoreTextHelpers.mm:
1217         (WebKit::fontWithAttributes):
1218         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
1219         * UIProcess/Cocoa/WKSafeBrowsingWarning.h:
1220         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
1221         (fontOfSize):
1222         (colorForItem):
1223         (-[WKSafeBrowsingBox setSafeBrowsingBackgroundColor:]):
1224         (-[WKSafeBrowsingWarning showDetailsClicked]):
1225         (-[WKSafeBrowsingTextView initWithAttributedString:forWarning:]):
1226         * UIProcess/Cocoa/WebViewImpl.mm:
1227         (WebKit::WebViewImpl::updateFontManagerIfNeeded):
1228         * WebKit.xcodeproj/project.pbxproj:
1229
1230 2020-05-06  Alex Christensen  <achristensen@webkit.org>
1231
1232         Reduce IPC overhead for message receiver name and message name to 2 bytes
1233         https://bugs.webkit.org/show_bug.cgi?id=211112
1234
1235         Reviewed by Chris Dumez.
1236
1237         * DerivedSources-output.xcfilelist:
1238         * DerivedSources.make:
1239         * GPUProcess/GPUConnectionToWebProcess.cpp:
1240         (WebKit::GPUConnectionToWebProcess::didReceiveInvalidMessage):
1241         * GPUProcess/GPUConnectionToWebProcess.h:
1242         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1243         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
1244         (WebKit::NetworkConnectionToWebProcess::didReceiveSyncMessage):
1245         (WebKit::NetworkConnectionToWebProcess::didReceiveInvalidMessage):
1246         * NetworkProcess/NetworkConnectionToWebProcess.h:
1247         * NetworkProcess/NetworkProcess.cpp:
1248         (WebKit::NetworkProcess::didReceiveMessage):
1249         (WebKit::NetworkProcess::didReceiveSyncMessage):
1250         * NetworkProcess/ios/NetworkConnectionToWebProcessIOS.mm:
1251         (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorAddMessageReceiver): Deleted.
1252         (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorRemoveMessageReceiver): Deleted.
1253         * Platform/IPC/Connection.cpp:
1254         (IPC::Connection::WaitForMessageState::WaitForMessageState):
1255         (IPC::Connection::addWorkQueueMessageReceiver):
1256         (IPC::Connection::removeWorkQueueMessageReceiver):
1257         (IPC::Connection::dispatchWorkQueueMessageReceiverMessage):
1258         (IPC::Connection::addThreadMessageReceiver):
1259         (IPC::Connection::removeThreadMessageReceiver):
1260         (IPC::Connection::dispatchThreadMessageReceiverMessage):
1261         (IPC::Connection::createSyncMessageEncoder):
1262         (IPC::Connection::sendMessage):
1263         (IPC::Connection::waitForMessage):
1264         (IPC::Connection::sendSyncMessage):
1265         (IPC::Connection::waitForSyncReply):
1266         (IPC::Connection::processIncomingMessage):
1267         (IPC::Connection::dispatchSyncMessage):
1268         (IPC::Connection::dispatchDidReceiveInvalidMessage):
1269         (IPC::Connection::dispatchMessage):
1270         (IPC::Connection::dispatchMessageToWorkQueueReceiver):
1271         (IPC::Connection::dispatchMessageToThreadReceiver):
1272         (IPC::Connection::dispatchIncomingMessages):
1273         * Platform/IPC/Connection.h:
1274         (IPC::Connection::send):
1275         (IPC::Connection::sendWithAsyncReply):
1276         (IPC::Connection::sendSync):
1277         (IPC::Connection::waitForAndDispatchImmediately):
1278         * Platform/IPC/Decoder.cpp:
1279         * Platform/IPC/Decoder.h:
1280         (IPC::Decoder::messageReceiverName const):
1281         (IPC::Decoder::messageName const):
1282         (IPC::Decoder::decode):
1283         (IPC::Decoder::operator>>):
1284         * Platform/IPC/Encoder.cpp:
1285         (IPC::Encoder::Encoder):
1286         (IPC::Encoder::encodeHeader):
1287         * Platform/IPC/Encoder.h:
1288         * Platform/IPC/HandleMessage.h:
1289         (IPC::handleMessageAsync):
1290         * Platform/IPC/MessageReceiverMap.cpp:
1291         (IPC::MessageReceiverMap::addMessageReceiver):
1292         (IPC::MessageReceiverMap::removeMessageReceiver):
1293         (IPC::MessageReceiverMap::dispatchMessage):
1294         (IPC::MessageReceiverMap::dispatchSyncMessage):
1295         * Platform/IPC/MessageReceiverMap.h:
1296         * Platform/IPC/MessageSender.h:
1297         * Platform/IPC/cocoa/ConnectionCocoa.mm:
1298         (IPC::Connection::open):
1299         (IPC::Connection::sendMessage):
1300         (IPC::Connection::sendOutgoingMessage):
1301         (IPC::Connection::receiveSourceEventHandler):
1302         * Platform/IPC/cocoa/MachMessage.cpp:
1303         (IPC::MachMessage::create):
1304         (IPC::MachMessage::MachMessage):
1305         * Platform/IPC/cocoa/MachMessage.h:
1306         (IPC::MachMessage::messageReceiverName const):
1307         (IPC::MachMessage::messageName const):
1308         * PluginProcess/WebProcessConnection.cpp:
1309         (WebKit::WebProcessConnection::didReceiveInvalidMessage):
1310         * PluginProcess/WebProcessConnection.h:
1311         * Scripts/Makefile:
1312         * Scripts/generate-message-receiver.py:
1313         (main):
1314         * Scripts/webkit/LegacyMessages-expected.h: Removed.
1315         * Scripts/webkit/LegacyMessagesReplies-expected.h: Removed.
1316         * Scripts/webkit/MessageNames.cpp: Added.
1317         (IPC::description):
1318         * Scripts/webkit/MessageNames.h: Added.
1319         (IPC::receiverName):
1320         (WTF::isValidEnum):
1321         * Scripts/webkit/MessageReceiver-expected.cpp: Removed.
1322         * Scripts/webkit/MessageReceiverSuperclass-expected.cpp: Removed.
1323         * Scripts/webkit/Messages-expected.h: Removed.
1324         * Scripts/webkit/MessagesReplies-expected.h: Removed.
1325         * Scripts/webkit/MessagesRepliesSuperclassReplies-expected.h: Removed.
1326         * Scripts/webkit/MessagesSuperclass-expected.h: Removed.
1327         * Scripts/webkit/messages.py:
1328         * Scripts/webkit/test-legacy-messages.in: Removed.
1329         * Scripts/webkit/test-legacy.messages.in: Copied from Source/WebKit/Scripts/webkit/test-legacy-messages.in.
1330         * Scripts/webkit/test-legacyMessageReceiver.cpp: Added.
1331         (Messages::WebPage::GetPluginProcessConnection::send):
1332         (Messages::WebPage::TestMultipleAttributes::send):
1333         (WebKit::WebPage::didReceiveWebPageMessage):
1334         (WebKit::WebPage::didReceiveSyncWebPageMessage):
1335         * Scripts/webkit/test-legacyMessages.h: Added.
1336         (Messages::WebPage::messageReceiverName):
1337         (Messages::WebPage::LoadURL::name):
1338         (Messages::WebPage::LoadURL::LoadURL):
1339         (Messages::WebPage::LoadURL::arguments const):
1340         (Messages::WebPage::LoadSomething::name):
1341         (Messages::WebPage::LoadSomething::LoadSomething):
1342         (Messages::WebPage::LoadSomething::arguments const):
1343         (Messages::WebPage::TouchEvent::name):
1344         (Messages::WebPage::TouchEvent::TouchEvent):
1345         (Messages::WebPage::TouchEvent::arguments const):
1346         (Messages::WebPage::AddEvent::name):
1347         (Messages::WebPage::AddEvent::AddEvent):
1348         (Messages::WebPage::AddEvent::arguments const):
1349         (Messages::WebPage::LoadSomethingElse::name):
1350         (Messages::WebPage::LoadSomethingElse::LoadSomethingElse):
1351         (Messages::WebPage::LoadSomethingElse::arguments const):
1352         (Messages::WebPage::DidReceivePolicyDecision::name):
1353         (Messages::WebPage::DidReceivePolicyDecision::DidReceivePolicyDecision):
1354         (Messages::WebPage::DidReceivePolicyDecision::arguments const):
1355         (Messages::WebPage::Close::name):
1356         (Messages::WebPage::Close::arguments const):
1357         (Messages::WebPage::PreferencesDidChange::name):
1358         (Messages::WebPage::PreferencesDidChange::PreferencesDidChange):
1359         (Messages::WebPage::PreferencesDidChange::arguments const):
1360         (Messages::WebPage::SendDoubleAndFloat::name):
1361         (Messages::WebPage::SendDoubleAndFloat::SendDoubleAndFloat):
1362         (Messages::WebPage::SendDoubleAndFloat::arguments const):
1363         (Messages::WebPage::SendInts::name):
1364         (Messages::WebPage::SendInts::SendInts):
1365         (Messages::WebPage::SendInts::arguments const):
1366         (Messages::WebPage::CreatePlugin::name):
1367         (Messages::WebPage::CreatePlugin::CreatePlugin):
1368         (Messages::WebPage::CreatePlugin::arguments const):
1369         (Messages::WebPage::RunJavaScriptAlert::name):
1370         (Messages::WebPage::RunJavaScriptAlert::RunJavaScriptAlert):
1371         (Messages::WebPage::RunJavaScriptAlert::arguments const):
1372         (Messages::WebPage::GetPlugins::name):
1373         (Messages::WebPage::GetPlugins::GetPlugins):
1374         (Messages::WebPage::GetPlugins::arguments const):
1375         (Messages::WebPage::GetPluginProcessConnection::name):
1376         (Messages::WebPage::GetPluginProcessConnection::GetPluginProcessConnection):
1377         (Messages::WebPage::GetPluginProcessConnection::arguments const):
1378         (Messages::WebPage::TestMultipleAttributes::name):
1379         (Messages::WebPage::TestMultipleAttributes::arguments const):
1380         (Messages::WebPage::TestParameterAttributes::name):
1381         (Messages::WebPage::TestParameterAttributes::TestParameterAttributes):
1382         (Messages::WebPage::TestParameterAttributes::arguments const):
1383         (Messages::WebPage::TemplateTest::name):
1384         (Messages::WebPage::TemplateTest::TemplateTest):
1385         (Messages::WebPage::TemplateTest::arguments const):
1386         (Messages::WebPage::SetVideoLayerID::name):
1387         (Messages::WebPage::SetVideoLayerID::SetVideoLayerID):
1388         (Messages::WebPage::SetVideoLayerID::arguments const):
1389         (Messages::WebPage::DidCreateWebProcessConnection::name):
1390         (Messages::WebPage::DidCreateWebProcessConnection::DidCreateWebProcessConnection):
1391         (Messages::WebPage::DidCreateWebProcessConnection::arguments const):
1392         (Messages::WebPage::InterpretKeyEvent::name):
1393         (Messages::WebPage::InterpretKeyEvent::InterpretKeyEvent):
1394         (Messages::WebPage::InterpretKeyEvent::arguments const):
1395         (Messages::WebPage::DeprecatedOperation::name):
1396         (Messages::WebPage::DeprecatedOperation::DeprecatedOperation):
1397         (Messages::WebPage::DeprecatedOperation::arguments const):
1398         (Messages::WebPage::ExperimentalOperation::name):
1399         (Messages::WebPage::ExperimentalOperation::ExperimentalOperation):
1400         (Messages::WebPage::ExperimentalOperation::arguments const):
1401         * Scripts/webkit/test-legacyMessagesReplies.h: Added.
1402         * Scripts/webkit/test-messages.in: Removed.
1403         * Scripts/webkit/test-superclass-messages.in: Removed.
1404         * Scripts/webkit/test-superclass.messages.in: Copied from Source/WebKit/Scripts/webkit/test-superclass-messages.in.
1405         * Scripts/webkit/test-superclassMessageReceiver.cpp: Added.
1406         (Messages::WebPage::TestAsyncMessage::callReply):
1407         (Messages::WebPage::TestAsyncMessage::cancelReply):
1408         (Messages::WebPage::TestAsyncMessage::send):
1409         (Messages::WebPage::TestAsyncMessageWithNoArguments::callReply):
1410         (Messages::WebPage::TestAsyncMessageWithNoArguments::cancelReply):
1411         (Messages::WebPage::TestAsyncMessageWithNoArguments::send):
1412         (Messages::WebPage::TestAsyncMessageWithMultipleArguments::callReply):
1413         (Messages::WebPage::TestAsyncMessageWithMultipleArguments::cancelReply):
1414         (Messages::WebPage::TestAsyncMessageWithMultipleArguments::send):
1415         (Messages::WebPage::TestSyncMessage::send):
1416         (Messages::WebPage::TestSynchronousMessage::send):
1417         (WebKit::WebPage::didReceiveMessage):
1418         (WebKit::WebPage::didReceiveSyncMessage):
1419         * Scripts/webkit/test-superclassMessages.h: Added.
1420         (Messages::WebPage::messageReceiverName):
1421         (Messages::WebPage::LoadURL::name):
1422         (Messages::WebPage::LoadURL::LoadURL):
1423         (Messages::WebPage::LoadURL::arguments const):
1424         (Messages::WebPage::TestAsyncMessage::name):
1425         (Messages::WebPage::TestAsyncMessage::asyncMessageReplyName):
1426         (Messages::WebPage::TestAsyncMessage::TestAsyncMessage):
1427         (Messages::WebPage::TestAsyncMessage::arguments const):
1428         (Messages::WebPage::TestAsyncMessageWithNoArguments::name):
1429         (Messages::WebPage::TestAsyncMessageWithNoArguments::asyncMessageReplyName):
1430         (Messages::WebPage::TestAsyncMessageWithNoArguments::arguments const):
1431         (Messages::WebPage::TestAsyncMessageWithMultipleArguments::name):
1432         (Messages::WebPage::TestAsyncMessageWithMultipleArguments::asyncMessageReplyName):
1433         (Messages::WebPage::TestAsyncMessageWithMultipleArguments::arguments const):
1434         (Messages::WebPage::TestSyncMessage::name):
1435         (Messages::WebPage::TestSyncMessage::TestSyncMessage):
1436         (Messages::WebPage::TestSyncMessage::arguments const):
1437         (Messages::WebPage::TestSynchronousMessage::name):
1438         (Messages::WebPage::TestSynchronousMessage::TestSynchronousMessage):
1439         (Messages::WebPage::TestSynchronousMessage::arguments const):
1440         * Scripts/webkit/test-superclassMessagesReplies.h: Added.
1441         * Scripts/webkit/test.messages.in: Added.
1442         * Scripts/webkit/testMessageReceiver.cpp: Added.
1443         * Scripts/webkit/testMessages.h: Added.
1444         (Messages::None::messageReceiverName):
1445         * Scripts/webkit/testMessagesReplies.h: Added.
1446         * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
1447         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1448         (WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy):
1449         (WebKit::WebPaymentCoordinatorProxy::~WebPaymentCoordinatorProxy):
1450         * Shared/AuxiliaryProcess.cpp:
1451         (WebKit::AuxiliaryProcess::addMessageReceiver):
1452         (WebKit::AuxiliaryProcess::removeMessageReceiver):
1453         (WebKit::AuxiliaryProcess::didReceiveInvalidMessage):
1454         * Shared/AuxiliaryProcess.h:
1455         (WebKit::AuxiliaryProcess::addMessageReceiver):
1456         (WebKit::AuxiliaryProcess::removeMessageReceiver):
1457         * Shared/Cocoa/AuxiliaryProcessCocoa.mm:
1458         (WebKit::AuxiliaryProcess::didReceiveInvalidMessage):
1459         * SourcesCocoa.txt:
1460         * UIProcess/AuxiliaryProcessProxy.cpp:
1461         (WebKit::AuxiliaryProcessProxy::addMessageReceiver):
1462         (WebKit::AuxiliaryProcessProxy::removeMessageReceiver):
1463         (WebKit::AuxiliaryProcessProxy::logInvalidMessage):
1464         * UIProcess/AuxiliaryProcessProxy.h:
1465         (WebKit::AuxiliaryProcessProxy::addMessageReceiver):
1466         (WebKit::AuxiliaryProcessProxy::removeMessageReceiver):
1467         (WebKit::AuxiliaryProcessProxy::send):
1468         (WebKit::AuxiliaryProcessProxy::sendWithAsyncReply):
1469         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
1470         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
1471         (WebKit::WebPageProxy::paymentCoordinatorAddMessageReceiver): Deleted.
1472         (WebKit::WebPageProxy::paymentCoordinatorRemoveMessageReceiver): Deleted.
1473         * UIProcess/GPU/GPUProcessProxy.cpp:
1474         (WebKit::GPUProcessProxy::didReceiveInvalidMessage):
1475         * UIProcess/GPU/GPUProcessProxy.h:
1476         * UIProcess/Network/NetworkProcessProxy.cpp:
1477         (WebKit::NetworkProcessProxy::didReceiveInvalidMessage):
1478         * UIProcess/Network/NetworkProcessProxy.h:
1479         * UIProcess/Plugins/PluginProcessProxy.cpp:
1480         (WebKit::PluginProcessProxy::didReceiveInvalidMessage):
1481         * UIProcess/Plugins/PluginProcessProxy.h:
1482         * UIProcess/ProvisionalPageProxy.cpp:
1483         (WebKit::ProvisionalPageProxy::didReceiveMessage):
1484         * UIProcess/SuspendedPageProxy.cpp:
1485         (WebKit::messageNamesToIgnoreWhileSuspended):
1486         (WebKit::SuspendedPageProxy::didReceiveMessage):
1487         * UIProcess/WebPageProxy.h:
1488         * UIProcess/WebProcessPool.cpp:
1489         (WebKit::WebProcessPool::didReceiveInvalidMessage):
1490         (WebKit::WebProcessPool::addMessageReceiver):
1491         (WebKit::WebProcessPool::removeMessageReceiver):
1492         * UIProcess/WebProcessPool.h:
1493         * UIProcess/WebProcessProxy.cpp:
1494         (WebKit::WebProcessProxy::shouldSendPendingMessage):
1495         (WebKit::WebProcessProxy::didReceiveInvalidMessage):
1496         * UIProcess/WebProcessProxy.h:
1497         * WebProcess/GPU/GPUProcessConnection.cpp:
1498         (WebKit::GPUProcessConnection::didReceiveInvalidMessage):
1499         * WebProcess/GPU/GPUProcessConnection.h:
1500         * WebProcess/Inspector/WebInspector.h:
1501         * WebProcess/Inspector/WebInspectorUI.h:
1502         * WebProcess/Network/NetworkProcessConnection.cpp:
1503         (WebKit::NetworkProcessConnection::didReceiveInvalidMessage):
1504         * WebProcess/Network/NetworkProcessConnection.h:
1505         * WebProcess/Plugins/PluginProcessConnection.cpp:
1506         (WebKit::PluginProcessConnection::didReceiveInvalidMessage):
1507         * WebProcess/Plugins/PluginProcessConnection.h:
1508         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
1509         (WebKit::RemoteLayerTreeDrawingArea::updateRendering):
1510         * WebProcess/WebProcess.cpp:
1511         (WebKit::WebProcess::didReceiveMessage):
1512
1513 2020-05-06  Chris Dumez  <cdumez@apple.com>
1514
1515         REGRESSION (r260684): Reader background is lost after multitasking
1516         https://bugs.webkit.org/show_bug.cgi?id=211533
1517         <rdar://problem/62941837>
1518
1519         Unreviewed, revert r260684 due to regression.
1520
1521         * UIProcess/WebPageProxy.cpp:
1522         (WebKit::WebPageProxy::setShouldFireResizeEvents):
1523         * UIProcess/WebPageProxy.h:
1524         * UIProcess/ios/WKApplicationStateTrackingView.mm:
1525         (-[WKApplicationStateTrackingView _willBeginSnapshotSequence]):
1526         (-[WKApplicationStateTrackingView _didCompleteSnapshotSequence]):
1527         * WebProcess/WebPage/WebPage.cpp:
1528         (WebKit::WebPage::setShouldFireResizeEvents):
1529         * WebProcess/WebPage/WebPage.h:
1530         * WebProcess/WebPage/WebPage.messages.in:
1531
1532 2020-05-06  Kate Cheney  <katherine_cheney@apple.com>
1533
1534         ResourceLoadStatistics data summary call should create a web process pool if one doesn't exist
1535         https://bugs.webkit.org/show_bug.cgi?id=211520
1536         <rdar://problem/59869619>
1537
1538         Reviewed by Chris Dumez.
1539
1540         Ensures that a process pool and network process exist when requesting
1541         resource load statistics data.
1542
1543         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1544         (WebKit::WebsiteDataStore::getResourceLoadStatisticsDataSummary):
1545
1546 2020-05-06  Keith Rollin  <krollin@apple.com>
1547
1548         Better surfacing of the presenting parent PID in the Network process
1549         https://bugs.webkit.org/show_bug.cgi?id=211495
1550         <rdar://problem/62917205>
1551
1552         Reviewed by Youenn Fablet.
1553
1554         In Bug 205295, NetworkResourceLoader logging was improved, with one of
1555         the changes being that the PID of parent process that invoked the
1556         Network process was logged at the start of
1557         NetworkResourceLoader::start(). However, there was an execution path
1558         that skipped calling start()
1559         (NetworkConnectionToWebProcess::scheduleResourceLoad ->
1560         NetworkResourceLoader::startWithServiceWorker ->
1561         serviceWorkerDidNotHandle -> restartNetworkLoad -> startNetworkLoad),
1562         and so the the logging would not show the parent PID. This logging is
1563         needed for diagnostic purposes, so tweak the logging a little bit more
1564         in order to ensure we emit it. In this change, logging is added to
1565         various loading-related NetworkConnectionToWebProcess entry points
1566         (not just scheduleResourceLoad) in order to (a) ensure we emit the
1567         logging we want and (b) to give a clearer picture of what operations
1568         are being invoked in the Network process.
1569
1570         No new tests -- no new or changed functionality.
1571
1572         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1573         (WebKit::NetworkConnectionToWebProcess::hasUploadStateChanged):
1574         (WebKit::NetworkConnectionToWebProcess::resolveBlobReferences):
1575         (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
1576         (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
1577         (WebKit::NetworkConnectionToWebProcess::loadPing):
1578         (WebKit::NetworkConnectionToWebProcess::preconnectTo):
1579         (WebKit::NetworkConnectionToWebProcess::serverToContextConnectionNoLongerNeeded):
1580         * NetworkProcess/NetworkResourceLoader.cpp:
1581         (WebKit::NetworkResourceLoader::start):
1582
1583 2020-05-06  Wenson Hsieh  <wenson_hsieh@apple.com>
1584
1585         Cut and paste from Google Doc to Notes in several (non-Latin) languages doesn't work
1586         https://bugs.webkit.org/show_bug.cgi?id=211498
1587         <rdar://problem/56675345>
1588
1589         Reviewed by Darin Adler.
1590
1591         Add a new header to allow Cocoa code to reason about UIColors and NSColors on iOS and macOS (respectively)
1592         without requiring platform ifdefs. A followup patch will adopt this in several places in WebKit, where we
1593         currently need ifdefs for iOS and macOS.
1594
1595         * Platform/cocoa/CocoaColor.h: Added.
1596         * WebKit.xcodeproj/project.pbxproj:
1597
1598 2020-05-06  Antoine Quint  <graouts@apple.com>
1599
1600         pointermove event sometimes has incorrect pointerType of 'mouse' on touch interactions
1601         https://bugs.webkit.org/show_bug.cgi?id=210716
1602         <rdar://problem/62084817>
1603
1604         Reviewed by Darin Adler.
1605
1606         Set the SyntheticClickType to OneFingerTap when creating a synthetic "mousemove" event for a synthetic "click" event as part of a tap.
1607         On top of being more indicative of the actual action that triggered the synthetic event, it also has the added quality that it will
1608         not yield a "pointermove" event.
1609
1610         Test: pointerevents/ios/click-no-pointermove.html
1611
1612         * WebProcess/WebPage/ios/WebPageIOS.mm:
1613         (WebKit::dispatchSyntheticMouseMove):
1614
1615 2020-05-06  John Wilander  <wilander@apple.com>
1616
1617         Exempt app-bound domains from ITP's website data deletion and third-party cookie blocking between themselves
1618         https://bugs.webkit.org/show_bug.cgi?id=210674
1619         <rdar://problem/61950767>
1620
1621         Reviewed by Chris Dumez.
1622
1623         This change forwards information about app-bound domains to ITP and web
1624         processes so that they can be exempt from website data deletion and
1625         third-party cookie blocking between themselves.
1626
1627         App-bound domains are configured statically and apply to all website
1628         data stores. Therefore the setting needs to be forwarded to all
1629         website data stores and ITP functionality in all network and web
1630         content processes. This is done through the new static function
1631         WebsiteDataStore::setAppBoundDomainsForITPIfInitialized().
1632
1633         Since app-bound domains are loaded lazily from disk and on a background
1634         thread, this patch forwards them in ResourceLoadStatisticsParameters if
1635         they've already been loaded. Then every time app-bound domains are
1636         updated, they are forwarded to ITP. This ensures that ITP will have them
1637         as soon as possible.
1638
1639         Setting app-bound domains for the purposes of ITP automatically switches
1640         ITP's cookie blocking policy to the new
1641         WebCore::ThirdPartyCookieBlockingMode::AllExceptBetweenAppBoundDomains.
1642         This is done in WebResourceLoadStatisticsStore::setAppBoundDomains().
1643
1644         The C API changes are for test purposes.
1645
1646         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
1647         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
1648         (WebKit::ResourceLoadStatisticsMemoryStore::registrableDomainsToDeleteOrRestrictWebsiteDataFor):
1649         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
1650         (WebKit::ResourceLoadStatisticsStore::setAppBoundDomains):
1651         (WebKit::ResourceLoadStatisticsStore::resetParametersToDefaultValues):
1652         (WebKit::ResourceLoadStatisticsStore::shouldExemptFromWebsiteDataDeletion const):
1653         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
1654         (WebKit::ResourceLoadStatisticsStore::standaloneApplicationDomain const): Deleted.
1655         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
1656         (WebKit::WebResourceLoadStatisticsStore::setAppBoundDomains):
1657         (WebKit::WebResourceLoadStatisticsStore::resetParametersToDefaultValues):
1658         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
1659         * NetworkProcess/NetworkProcess.cpp:
1660         (WebKit::NetworkProcess::setAppBoundDomainsForResourceLoadStatistics):
1661         (WebKit::NetworkProcess::setThirdPartyCookieBlockingMode):
1662         (WebKit::NetworkProcess::setShouldBlockThirdPartyCookiesForTesting): Deleted.
1663             Renamed setThirdPartyCookieBlockingMode.
1664         * NetworkProcess/NetworkProcess.h:
1665         * NetworkProcess/NetworkProcess.messages.in:
1666         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1667         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1668         * Shared/ResourceLoadStatisticsParameters.h:
1669         (WebKit::ResourceLoadStatisticsParameters::encode const):
1670         (WebKit::ResourceLoadStatisticsParameters::decode):
1671         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1672         (WKWebsiteDataStoreSetAppBoundDomainsForTesting):
1673         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1674         * UIProcess/Network/NetworkProcessProxy.cpp:
1675         (WebKit::NetworkProcessProxy::setAppBoundDomainsForResourceLoadStatistics):
1676         (WebKit::NetworkProcessProxy::setThirdPartyCookieBlockingMode):
1677         (WebKit::NetworkProcessProxy::setShouldBlockThirdPartyCookiesForTesting): Deleted.
1678             Renamed setThirdPartyCookieBlockingMode.
1679         * UIProcess/Network/NetworkProcessProxy.h:
1680         * UIProcess/WebProcessPool.cpp:
1681         (WebKit::WebProcessPool::ensureNetworkProcess):
1682         * UIProcess/WebProcessProxy.cpp:
1683         (WebKit::WebProcessProxy::setThirdPartyCookieBlockingMode):
1684         (WebKit::WebProcessProxy::setShouldBlockThirdPartyCookiesForTesting): Deleted.
1685             Renamed setThirdPartyCookieBlockingMode.
1686         * UIProcess/WebProcessProxy.h:
1687         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
1688         (WebKit::WebsiteDataStore::initializeAppBoundDomains):
1689         (WebKit::WebsiteDataStore::ensureAppBoundDomains const):
1690         (WebKit::WebsiteDataStore::appBoundDomainsIfInitialized):
1691             This function allows fetching of app-bound domains without triggering
1692             the lazy loading. This is just to allow speculative configuration of ITP
1693             right when it's created — if any app-bound domains are already configured,
1694             forward them to ITP via ResourceLoadStatisticsParameters.
1695         (WebKit::WebsiteDataStore::setAppBoundDomainsForTesting):
1696             This function is Cocoa-specific and only accepts localhost and 127.0.0.1
1697             to be configured as app-bound domains.
1698         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1699         (WebKit::WebsiteDataStore::setResourceLoadStatisticsShouldBlockThirdPartyCookiesForTesting):
1700         (WebKit::WebsiteDataStore::setThirdPartyCookieBlockingMode):
1701         (WebKit::WebsiteDataStore::parameters):
1702         (WebKit::WebsiteDataStore::forwardAppBoundDomainsToITPIfInitialized):
1703         (WebKit::WebsiteDataStore::setAppBoundDomainsForITP):
1704         * UIProcess/WebsiteData/WebsiteDataStore.h:
1705         * WebProcess/WebProcess.cpp:
1706         (WebKit::WebProcess::setThirdPartyCookieBlockingMode):
1707         (WebKit::WebProcess::setShouldBlockThirdPartyCookiesForTesting): Deleted.
1708         * WebProcess/WebProcess.h:
1709         * WebProcess/WebProcess.messages.in:
1710
1711 2020-05-06  Daniel Bates  <dabates@apple.com>
1712
1713         [iOS] ASSERTION FAILED: !(_keyboardFlags & WebEventKeyboardInputModifierFlagsChanged) in -[WebEvent charactersIgnoringModifiers] when pressing modifier on PDF
1714         https://bugs.webkit.org/show_bug.cgi?id=211472
1715
1716         Reviewed by Darin Adler.
1717
1718         Do not ask for event character string for a flags changed event: they don't have one.
1719
1720         Test: fast/events/ios/pdf-modifer-key-down-crash.html
1721
1722         * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
1723         (-[WKKeyboardScrollingAnimator keyboardScrollForEvent:]):
1724
1725 2020-05-06  Brent Fulgham  <bfulgham@apple.com>
1726
1727         [MacCatalyst] Processes should check for network entitlement as we do for macOS apps
1728         https://bugs.webkit.org/show_bug.cgi?id=211474
1729         <rdar://problem/61182060>
1730
1731         Reviewed by Alexey Proskuryakov.
1732
1733         We should make the same entitlement checks in MacCatalyst as we do for macOS.
1734
1735         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm:
1736         (WebKit::XPCServiceInitializerDelegate::checkEntitlements):
1737
1738 2020-05-06  Darin Adler  <darin@apple.com>
1739
1740         Eliminate checks of USE(DICTATION_ALTERNATIVES) in Cocoa-specific code
1741         https://bugs.webkit.org/show_bug.cgi?id=211460
1742
1743         Reviewed by Anders Carlsson.
1744
1745         * UIProcess/Cocoa/PageClientImplCocoa.h: Remove USE(DICTATION_ALTERNATIVES).
1746         Also remove unnecessary use of RetainPtr.
1747         * UIProcess/Cocoa/PageClientImplCocoa.mm:
1748         (WebKit::PageClientImplCocoa::PageClientImplCocoa): Ditto.
1749         (WebKit::PageClientImplCocoa::pageClosed): Ditto.
1750         (WebKit::PageClientImplCocoa::dictationAlternatives): Ditto.
1751         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
1752         (WebKit::WebPageProxy::insertDictatedTextAsync): Ditto.
1753         * UIProcess/Cocoa/WebViewImpl.mm:
1754         (WebKit::WebViewImpl::validAttributesForMarkedText): Ditto.
1755         (WebKit::WebViewImpl::insertText): Ditto.
1756         * UIProcess/PageClient.h: Ditto.
1757         * UIProcess/ios/PageClientImplIOS.h: Ditto.
1758         * UIProcess/ios/PageClientImplIOS.mm: Ditto.
1759         * UIProcess/ios/WKContentViewInteraction.mm: Ditto.
1760         * UIProcess/mac/PageClientImplMac.h: Ditto.
1761         * UIProcess/mac/PageClientImplMac.mm: Ditto.
1762         * WebProcess/WebCoreSupport/mac/WebAlternativeTextClient.cpp: Ditto.
1763
1764 2020-05-06  Lauro Moura  <lmoura@igalia.com>
1765
1766         [GTK] Cleanup KeyBindingTranslator on WebView disposal
1767         https://bugs.webkit.org/show_bug.cgi?id=211465
1768
1769         Reviewed by Carlos Garcia Campos.
1770
1771         Fixes assertion in debug mode when a test failed and the widget
1772         followed a destruction pattern where KeyBindingTranslator would be
1773         destroyed before the container widget is cleaned up.
1774
1775         Also renamed the method from 'destroyed' to 'invalidate' to try to
1776         better convey the action being performed on the KeyBindingTranslator.
1777
1778         Covered by existing tests.
1779
1780         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1781         (webkitWebViewBaseContainerRemove): Update method name.
1782         (webkitWebViewBaseDispose): Cleanup keyBindingTranslator when
1783         disposing this widget.
1784         * UIProcess/gtk/KeyBindingTranslator.h:
1785         (WebKit::KeyBindingTranslator::invalidate): Renamed from destroyed.
1786         (WebKit::KeyBindingTranslator::destroyed): Deleted.
1787
1788 2020-05-06  Darin Adler  <darin@apple.com>
1789
1790         Reduce HAVE(HOSTED_CORE_ANIMATION)
1791         https://bugs.webkit.org/show_bug.cgi?id=211423
1792
1793         Reviewed by Anders Carlsson.
1794
1795         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1796         (WebKit::WebProcessPool::platformInitializeWebProcess): Removed redundant #if
1797         checking both HAVE(HOSTED_CORE_ANIMATION) and !PLATFORM(IOS_FAMILY).
1798
1799         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
1800         (WebKit::PluginProcessProxy::platformInitializePluginProcess): Removed unnecessary
1801         HAVE(HOSTED_CORE_ANIMATION) check in code that is only compiled for macOS.
1802
1803 2020-05-05  David Kilzer  <ddkilzer@apple.com>
1804
1805         Fix deprecated NSGraphicsContext methods using 'graphicsPort'
1806         <https://webkit.org/b/211481>
1807
1808         Reviewed by Darin Adler.
1809
1810         - Replace uses of -graphicsPort with -CGContext.
1811         - Replace uses of -graphicsContextWithGraphicsPort:flipped: with
1812           -graphicsContextWithCGContext:flipped:.
1813         - Remove ALLOW_DEPRECATED_DECLARATIONS_{BEGIN,END} if possible.
1814
1815         * UIProcess/mac/WKPrintingView.mm:
1816         (-[WKPrintingView _drawPDFDocument:page:atPoint:]):
1817         (-[WKPrintingView _drawPreview:]):
1818         * WebProcess/WebPage/mac/WebPageMac.mm:
1819         (WebKit::drawPDFPage):
1820
1821 2020-05-05  Zalan Bujtas  <zalan@apple.com>
1822
1823         [Quirk] Job listing page goes blank when scrolling on stackoverflow.com
1824         https://bugs.webkit.org/show_bug.cgi?id=211480
1825         <rdar://problem/62558405>
1826
1827         Reviewed by Wenson Hsieh.
1828
1829         Add the option of returning "use desktop web content" on any configuration when the host application asks for content recommendation.
1830
1831         * UIProcess/ios/WebPageProxyIOS.mm:
1832         (WebKit::desktopClassBrowsingRecommendedForRequest):
1833         (WebKit::desktopClassBrowsingRecommended):
1834         (WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):
1835
1836 2020-05-05  Chris Dumez  <cdumez@apple.com>
1837
1838         Crash under _LSSetApplicationInformationItem()
1839         https://bugs.webkit.org/show_bug.cgi?id=211478
1840         <rdar://problem/62201314>
1841
1842         Reviewed by Alex Christensen.
1843
1844         Given the crashes, I suspect it is not actually safe to call _LSSetApplicationInformationItem()
1845         from a non main-thread like it was done in r238289. We still run the code asynchronously to
1846         address the issue that r238289 was trying to fix but we now call _LSSetApplicationInformationItem()
1847         on the main thread.
1848
1849         * WebProcess/cocoa/WebProcessCocoa.mm:
1850         (WebKit::WebProcess::updateProcessName):
1851         (WebKit::WebProcess::updateActivePages):
1852         (WebKit::setProcessNameQueue): Deleted.
1853
1854 2020-05-05  Peng Liu  <peng.liu6@apple.com>
1855
1856         Update WebKitTestRunner to support running multiple video fullscreen and Picture-in-Picture tests simultaneously
1857         https://bugs.webkit.org/show_bug.cgi?id=203723
1858
1859         Reviewed by Jer Noble.
1860
1861         When the flag MockVideoPresentationModeEnabled is true, the VideoFullscreenManagerProxy in the UI process
1862         will mock the behavior of the VideoFullscreenInterface[Mac|AVKit].
1863
1864         * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
1865         (WebKit::VideoFullscreenManagerProxy::setMockVideoPresentationModeEnabled):
1866         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
1867         (WebKit::VideoFullscreenManagerProxy::requestHideAndExitFullscreen):
1868         (WebKit::VideoFullscreenManagerProxy::applicationDidBecomeActive):
1869         (WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID):
1870         (WebKit::VideoFullscreenManagerProxy::setHasVideo):
1871         (WebKit::VideoFullscreenManagerProxy::setVideoDimensions):
1872         (WebKit::VideoFullscreenManagerProxy::enterFullscreen):
1873         (WebKit::VideoFullscreenManagerProxy::exitFullscreen):
1874         (WebKit::VideoFullscreenManagerProxy::exitFullscreenWithoutAnimationToMode):
1875         (WebKit::VideoFullscreenManagerProxy::setInlineRect):
1876         (WebKit::VideoFullscreenManagerProxy::setHasVideoContentLayer):
1877         (WebKit::VideoFullscreenManagerProxy::cleanupFullscreen):
1878         (WebKit::VideoFullscreenManagerProxy::preparedToReturnToInline):
1879         (WebKit::VideoFullscreenManagerProxy::preparedToExitFullscreen):
1880         * UIProcess/WebPageProxy.cpp:
1881         (WebKit::WebPageProxy::didAttachToRunningProcess):
1882         (WebKit::WebPageProxy::setMockVideoPresentationModeEnabled):
1883         * UIProcess/WebPageProxy.h:
1884         * UIProcess/WebPageProxy.messages.in:
1885         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1886         (WebKit::WebChromeClient::setMockVideoPresentationModeEnabled):
1887         (WebKit::WebChromeClient::setUpPlaybackControlsManager):
1888         (WebKit::WebChromeClient::clearPlaybackControlsManager):
1889         * WebProcess/WebCoreSupport/WebChromeClient.h:
1890         * WebProcess/cocoa/VideoFullscreenManager.h:
1891
1892 2020-05-05  Per Arne Vollan  <pvollan@apple.com>
1893
1894         Unreviewed fix for MotionMark regression.
1895
1896         Revert minor part of r260017. Remove telemetry from IOKit filtering allow rules. This telemetry is causing higher
1897         CPU usage on the system, and is not needed, since we have already confirmed these messages are being used.
1898
1899         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1900
1901 2020-05-05  Daniel Bates  <dabates@apple.com>
1902
1903         Should show selection highlight during text interaction
1904         https://bugs.webkit.org/show_bug.cgi?id=211362
1905         <rdar://problem/59191873>
1906
1907         Reviewed by Wenson Hsieh.
1908
1909         Break out text interaction tracking into its own ivar instead of using the
1910         WebKit::InteractionIsHappening selection suppression reason so that I can
1911         key off it to only disallow zooming to reveal the focused element during
1912         a text interaction. The selection suppression machinery does more than this.
1913         It also deactivates selection assistance, painting of highlights, etc, which
1914         I don't want.
1915
1916         * UIProcess/ios/WKContentViewInteraction.h:
1917         * UIProcess/ios/WKContentViewInteraction.mm:
1918         (-[WKContentView cleanUpInteraction]): Reset state.
1919         (-[WKContentView becomeFirstResponderForWebView]): Activate selection assistant
1920         during a text interaction if the selection assistant is not being suppressed.
1921         (-[WKContentView _zoomToRevealFocusedElement]): Early return if called during a
1922         text interaction. The function -_didFinishTextInteractionInTextInputContext will
1923         trigger the zoom after the interaction completes.
1924         (-[WKContentView _didCommitLoadForMainFrame]): Reset state.
1925
1926         (-[WKContentView _willBeginTextInteractionInTextInputContext:]):
1927         (-[WKContentView _didFinishTextInteractionInTextInputContext:]):
1928         Update state. While I am here, text interaction is considered a gesture so
1929         also update _usingGestureForSelection. This means that the selection view
1930         will be updated immediately on a selection change during a text interaction
1931         instead of waiting until the next layer tree commit occurs.
1932
1933 2020-05-05  Kate Cheney  <katherine_cheney@apple.com>
1934
1935         Check for app-bound domains should confirm WKAppBoundDomains key exists when checking for default app-bound protocols.
1936         https://bugs.webkit.org/show_bug.cgi?id=211451
1937         <rdar://problem/62715316
1938
1939         Reviewed by Brent Fulgham.
1940
1941         Checks for WKAppBoundDomains key before treating a protocol as
1942         app-bound. This is a regression in expected behavior after making
1943         In-App Browser privacy opt-in based on the presence of the key.
1944
1945         Also moves the check for special protocols inside of the completion handler for
1946         ensureAppBoundDomains to make sure the check for the key has finished.
1947
1948         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
1949         (WebKit::WebsiteDataStore::beginAppBoundDomainCheck):
1950         Added a comment to clarify why we need to check for both an empty
1951         app-bound domains list and the presence of the key for testing
1952         purposes.
1953
1954 2020-05-05  Timothy Horton  <timothy_horton@apple.com>
1955
1956         "Essential Skeleton" does not respond to mouse events, only touch events
1957         https://bugs.webkit.org/show_bug.cgi?id=211439
1958         <rdar://problem/62694519>
1959
1960         Reviewed by Wenson Hsieh.
1961
1962         * UIProcess/ios/WKContentViewInteraction.mm:
1963         (-[WKContentView shouldUseMouseGestureRecognizer]):
1964         Add a quirk.
1965
1966 2020-05-05  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
1967
1968         Compile GPUProcess in WPE port as experimental feature
1969         https://bugs.webkit.org/show_bug.cgi?id=211442
1970
1971         Reviewed by Don Olmstead.
1972
1973         Enable GPU Process in WPE.
1974
1975         This is compilation only. No new tests required.
1976
1977         * PlatformWPE.cmake: Add Platform/generic include directory.
1978         * SourcesWPE.txt: Add related source files.
1979
1980 2020-05-05  Youenn Fablet  <youenn@apple.com>
1981
1982         Remove LegacySchemeRegistry::canServiceWorkersHandleURLScheme
1983         https://bugs.webkit.org/show_bug.cgi?id=211170
1984
1985         Reviewed by Alex Christensen.
1986
1987         Remove unused parameters since they are no longer being set in UIProcess.
1988
1989         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1990         (WebKit::NetworkProcessCreationParameters::encode const):
1991         * NetworkProcess/NetworkProcessCreationParameters.h:
1992         * Shared/WebProcessCreationParameters.cpp:
1993         (WebKit::WebProcessCreationParameters::decode):
1994         * Shared/WebProcessCreationParameters.h:
1995         * WebProcess/WebProcess.cpp:
1996         (WebKit::WebProcess::initializeWebProcess):
1997
1998 2020-05-05  Darin Adler  <darin@apple.com>
1999
2000         Remove now-uneeded HAVE macros related to PDF
2001         https://bugs.webkit.org/show_bug.cgi?id=211435
2002
2003         Reviewed by Anders Carlsson.
2004
2005         * Platform/spi/ios/PDFKitSPI.h: Removed HAVE(PDFHOSTVIEWCONTROLLER_SNAPSHOTTING).
2006
2007         * UIProcess/ios/WKPDFView.mm:
2008         (-[WKPDFView web_initWithFrame:webView:mimeType:]): Removed
2009         HAVE(PDF_HOST_VIEW_CONTROLLER_WITH_BACKGROUND_COLOR).
2010         (+[WKPDFView web_requiresCustomSnapshotting]): Removed HAVE(PDFHOSTVIEWCONTROLLER_SNAPSHOTTING).
2011         (-[WKPDFView web_snapshotRectInContentViewCoordinates:snapshotWidth:completionHandler:]):
2012         Ditto.
2013
2014 2020-05-05  Youenn Fablet  <youenn@apple.com>
2015
2016         Receiving WebRTC network packets should not go through the main thread
2017         https://bugs.webkit.org/show_bug.cgi?id=211290
2018
2019         Reviewed by Alex Christensen.
2020
2021         Instead of going to main thread before going to rtc network thread, we register a message receiver and dispatch directly to rtc network thread.
2022         This ensures rtc packets are not blocked if main thread is busy.
2023
2024         * DerivedSources-input.xcfilelist:
2025         * DerivedSources-output.xcfilelist:
2026         * DerivedSources.make:
2027         * NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
2028         (WebKit::LibWebRTCSocketClient::signalReadPacket):
2029         (WebKit::LibWebRTCSocketClient::signalSentPacket):
2030         (WebKit::LibWebRTCSocketClient::signalAddressReady):
2031         (WebKit::LibWebRTCSocketClient::signalConnect):
2032         (WebKit::LibWebRTCSocketClient::signalClose):
2033         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
2034         (WebKit::NetworkRTCProvider::createSocket):
2035         (WebKit::NetworkRTCProvider::createServerTCPSocket):
2036         (WebKit::NetworkRTCProvider::createClientTCPSocket):
2037         (WebKit::NetworkRTCProvider::newConnection):
2038         (WebKit::NetworkRTCProvider::closeListeningSockets):
2039         * Sources.txt:
2040         * WebKit.xcodeproj/project.pbxproj:
2041         * WebProcess/Network/NetworkProcessConnection.cpp:
2042         (WebKit::NetworkProcessConnection::NetworkProcessConnection):
2043         (WebKit::NetworkProcessConnection::didReceiveMessage):
2044         * WebProcess/Network/webrtc/LibWebRTCNetwork.cpp: Added
2045         * WebProcess/Network/webrtc/LibWebRTCNetwork.h:
2046         (WebKit::LibWebRTCNetwork::connection):
2047         (WebKit::LibWebRTCNetwork::~LibWebRTCNetwork):
2048         (WebKit::LibWebRTCNetwork::networkProcessCrashed):
2049         (WebKit::LibWebRTCNetwork::setConnection):
2050         (WebKit::LibWebRTCNetwork::dispatchToThread):
2051         (WebKit::LibWebRTCNetwork::signalAddressReady):
2052         (WebKit::LibWebRTCNetwork::signalReadPacket):
2053         (WebKit::LibWebRTCNetwork::signalSentPacket):
2054         (WebKit::LibWebRTCNetwork::signalConnect):
2055         (WebKit::LibWebRTCNetwork::signalClose):
2056         (WebKit::LibWebRTCNetwork::signalNewConnection):
2057         * WebProcess/Network/webrtc/LibWebRTCNetwork.messages.in: Added.
2058         * WebProcess/Network/webrtc/LibWebRTCSocket.h:
2059         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
2060         * WebProcess/Network/webrtc/WebRTCSocket.cpp: Removed.
2061         * WebProcess/Network/webrtc/WebRTCSocket.h: Removed.
2062
2063 2020-05-05  Tim Horton  <timothy_horton@apple.com>
2064
2065         Excessive error logging from daemons trying to use WebKit, under -[UIDevice currentDevice]
2066         https://bugs.webkit.org/show_bug.cgi?id=211397
2067         <rdar://problem/61635403>
2068
2069         Reviewed by Simon Fraser.
2070
2071         * Shared/UserInterfaceIdiom.mm:
2072         (WebKit::userInterfaceIdiomIsPad):
2073         Adjust userInterfaceIdiomIsPad so that in daemons, it consults only MobileGestalt,
2074         which returns the actual hardware model, and does not try to use UIDevice.
2075         UIDevice is more accurate for applications because it will report that
2076         the device is an iPhone when called inside an iPhone app running on iPad,
2077         but it cannot be used in daemons that do not have a UIApplication.
2078         
2079         For the behaviors we gate on this bit, it makes sense to use iPhone
2080         behaviors on iPad in the iPhone app jail, so we continue using
2081         UIDevice if possible.
2082
2083         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2084         (-[WKWebViewConfiguration init]):
2085         Make use of the new mechanism instead of going straight to MobileGestalt,
2086         for the aforementioned reasons.
2087
2088 2020-05-04  Tim Horton  <timothy_horton@apple.com>
2089
2090         Relax WKRemoteObjectRegistry signature validation for bool-equivalent types
2091         https://bugs.webkit.org/show_bug.cgi?id=211419
2092
2093         Reviewed by Saam Barati.
2094
2095         * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
2096         (blockSignaturesAreCompatible):
2097         (replyBlockSignature):
2098         (-[_WKRemoteObjectRegistry _invokeMethod:]):
2099         (validateReplyBlockSignature): Deleted.
2100         Relax reply block signature validation slightly, considering signed char and BOOL,
2101         which are equivalent and sometimes substituted for each other, to be equal.
2102
2103         This is still stricter than NSXPC's validation, but this is one of the
2104         exceptions that they make.
2105
2106 2020-05-04  Darin Adler  <darin@apple.com>
2107
2108         [Mac] Remove __MAC_OS_X_VERSION_MIN_REQUIRED checks for versions older than 10.14
2109         https://bugs.webkit.org/show_bug.cgi?id=211420
2110
2111         Reviewed by Alex Christensen.
2112
2113         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
2114         (WebKit::Download::resume): Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400.
2115         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2116         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Ditto.
2117         * PluginProcess/mac/PluginProcessMac.mm:
2118         (WebKit::PluginProcess::platformInitializePluginProcess): Ditto.
2119         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
2120         (WebKit::XPCServiceMain): Ditto.
2121         * UIProcess/mac/ServicesController.mm:
2122         (WebKit::hasCompatibleServicesForItems): Ditto.
2123         * UIProcess/mac/WebProcessProxyMac.mm:
2124         (WebKit::WebProcessProxy::shouldAllowNonValidInjectedCode const): Ditto.
2125
2126 2020-05-04  Darin Adler  <darin@apple.com>
2127
2128         Remove now-unneeded HAVE(SANDBOX_ISSUE_MACH/READ_EXTENSION_TO_PROCESS_BY_AUDIT_TOKEN)
2129         https://bugs.webkit.org/show_bug.cgi?id=211427
2130
2131         Reviewed by Alex Christensen.
2132
2133         * Shared/Cocoa/SandboxExtensionCocoa.mm:
2134         (WebKit::SandboxExtensionImpl::sandboxExtensionForType): Remove #if HAVE.
2135
2136 2020-05-04  Darin Adler  <darin@apple.com>
2137
2138         Remove now-unneeded HAVE(AUTHORIZATION_STATUS_FOR_MEDIA_TYPE)
2139         https://bugs.webkit.org/show_bug.cgi?id=211426
2140
2141         Reviewed by Alex Christensen.
2142
2143         * UIProcess/Cocoa/UIDelegate.mm:
2144         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
2145         Remove HAVE(AUTHORIZATION_STATUS_FOR_MEDIA_TYPE).
2146
2147 2020-05-04  Darin Adler  <darin@apple.com>
2148
2149         Remove now-unneeded HAVE(ACCESSIBILITY_SUPPORT)
2150         https://bugs.webkit.org/show_bug.cgi?id=211425
2151
2152         Reviewed by Alex Christensen.
2153
2154         * Platform/spi/Cocoa/AccessibilitySupportSPI.h: Remove HAVE(ACCESSIBILITY_SUPPORT)
2155         and now-unnecessary C include guards.
2156
2157 2020-05-04  Darin Adler  <darin@apple.com>
2158
2159         Remove now-unneeded HAVE(SEC_TRUST_EVALUATE_WITH_ERROR)
2160         https://bugs.webkit.org/show_bug.cgi?id=211429
2161
2162         Reviewed by Alex Christensen.
2163
2164         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
2165         (-[WKFullScreenWindowController _EVOrganizationName]):
2166         Remove HAVE(SEC_TRUST_EVALUATE_WITH_ERROR).
2167
2168 2020-05-04  Kate Cheney  <katherine_cheney@apple.com>
2169
2170         REGRESSION (r260791?): Assert not reached in ResourceLoadStatisticsDatabaseStore::openAndUpdateSchemaIfNecessary() and ResourceLoadStatisticsDatabaseStore::addMissingTablesIfNecessary()
2171         https://bugs.webkit.org/show_bug.cgi?id=211305
2172         <rdar://problem/62737871>
2173
2174         Reviewed by Alex Christensen.
2175
2176         This patch adds a busy timeout for the ITP database to allow for
2177         some concurrency flexibility when running many WebKitTestRunner tests, which
2178         recreate the ITP database store very often to test both the memory and
2179         database stores.
2180
2181         With the timeout, an attempt to write to the database when another
2182         thread is holding the lock will keep attempting to insert for 5
2183         seconds as long as the statement execution returns SQLITE_BUSY.
2184
2185         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
2186         (WebKit::ResourceLoadStatisticsDatabaseStore::openITPDatabase):
2187
2188 2020-05-04  Alex Christensen  <achristensen@webkit.org>
2189
2190         TestWebKitAPI.WebKit.CustomDisplayName is a flaky timeout
2191         https://bugs.webkit.org/show_bug.cgi?id=211299
2192
2193         Reviewed by Chris Dumez.
2194
2195         Use a serial queue instead of a concurrent queue to set the web process's display name to prevent race conditions.
2196
2197         * WebProcess/cocoa/WebProcessCocoa.mm:
2198         (WebKit::setProcessNameQueue):
2199         (WebKit::WebProcess::updateProcessName):
2200         (WebKit::WebProcess::updateActivePages):
2201
2202 2020-05-04  Adrian Perez de Castro  <aperez@igalia.com>
2203
2204         [GTK4] Header bars no longer have title and subtitle properties
2205         https://bugs.webkit.org/show_bug.cgi?id=211412
2206
2207         Reviewed by Carlos Garcia Campos.
2208
2209         No new tests needed.
2210
2211         * UIProcess/Inspector/gtk/WebKitInspectorWindow.cpp: For GTK4 use a vertical
2212         box as title widget, with two labels acting as title and subtitle.
2213         (webkit_inspector_window_init):
2214         (webkitInspectorWindowSetSubtitle):
2215
2216 2020-05-04  Chris Dumez  <cdumez@apple.com>
2217
2218         [iOS] Make sure TestController::statisticsResetToConsistentState() does not hang due to process suspension
2219         https://bugs.webkit.org/show_bug.cgi?id=211421
2220
2221         Reviewed by Maciej Stachowiak.
2222
2223         We have evidence of hangs in TestController::statisticsResetToConsistentState() on iOS and we suspect it
2224         is due to process suspension. To address the issue, this patch updates the IPCs being sent as a result of
2225         a call to statisticsResetToConsistentState() to take a background assertion while waiting for the IPC
2226         response.
2227
2228         * UIProcess/Network/NetworkProcessProxy.cpp:
2229         (WebKit::NetworkProcessProxy::setUseITPDatabase):
2230         (WebKit::NetworkProcessProxy::resetCacheMaxAgeCapForPrevalentResources):
2231         (WebKit::NetworkProcessProxy::resetParametersToDefaultValues):
2232         (WebKit::NetworkProcessProxy::scheduleClearInMemoryAndPersistent):
2233         (WebKit::NetworkProcessProxy::resetCrossSiteLoadsWithLinkDecorationForTesting):
2234         (WebKit::NetworkProcessProxy::setShouldDowngradeReferrerForTesting):
2235         (WebKit::NetworkProcessProxy::setShouldBlockThirdPartyCookiesForTesting):
2236         (WebKit::NetworkProcessProxy::setShouldEnbleSameSiteStrictEnforcementForTesting):
2237         (WebKit::NetworkProcessProxy::setFirstPartyWebsiteDataRemovalModeForTesting):
2238         * UIProcess/WebProcessProxy.cpp:
2239         (WebKit::WebProcessProxy::setShouldBlockThirdPartyCookiesForTesting):
2240
2241 2020-05-04  Wenson Hsieh  <wenson_hsieh@apple.com>
2242
2243         Tapping to focus editable elements should start caret selection at word boundary
2244         https://bugs.webkit.org/show_bug.cgi?id=211409
2245         <rdar://problem/62869098>
2246
2247         Reviewed by Megan Gardner.
2248
2249         See WebCore/ChangeLog for more details.
2250
2251         * WebProcess/WebPage/ios/WebPageIOS.mm:
2252         (WebKit::WebPage::selectWithGesture):
2253
2254         Rewrite this using the new VisibleUnits helper function, `wordBoundaryForPositionWithoutCrossingLine`.
2255
2256 2020-05-04  Darin Adler  <darin@apple.com>
2257
2258         Make __IPHONE_OS_VERSION_MIN_REQUIRED checks against old versions explicit about watchOS and tvOS
2259         https://bugs.webkit.org/show_bug.cgi?id=211402
2260
2261         Reviewed by Alexey Proskuryakov.
2262
2263         * NetworkProcess/NetworkActivityTracker.h: Move from __IPHONE_OS_VERSION_MIN_REQUIRED
2264         to !PLATFORM(APPLETV). There was already an explicit watchOS case here.
2265
2266         * Platform/spi/ios/UIKitSPI.h: Move from __IPHONE_OS_VERSION_MIN_REQUIRED to
2267         PLATFORM(IOS) in one place, and in the other removed the conditional entirely.
2268         THe one place here that does PLATFORM(IOS) is for a property that is not on
2269         watchOS and tvOS at this time, related to dragging. Decided not to add a comment
2270         about it.
2271
2272         * Shared/WebPreferencesDefaultValues.h: Move from __IPHONE_OS_VERSION_MIN_REQUIRED
2273         to !PLATFORM(APPLETV). There was already an explicit watchOS case here.
2274
2275         * UIProcess/API/ios/WKWebViewIOS.mm:
2276         (contentOffsetBoundedInValidRange): Move from __IPHONE_OS_VERSION_MIN_REQUIRED
2277         to !PLATFORM(WATCHOS) && !PLATFORM(APPLETV).
2278         (-[WKWebView activeViewLayoutSize:]): Ditto.
2279         (-[WKWebView _updateScrollViewInsetAdjustmentBehavior]): Ditto.
2280         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
2281         (-[WKChildScrollView initWithFrame:]): Ditto.
2282         * UIProcess/ios/WKContentViewInteraction.mm:
2283         (-[WKContentView gestureRecognizer:canBePreventedByGestureRecognizer:]): Ditto.
2284         (-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]): Ditto.
2285         * UIProcess/ios/WKScrollView.h: Ditto.
2286         * UIProcess/ios/WKScrollView.mm:
2287         (-[WKScrollView initWithFrame:]): Ditto.
2288
2289 2020-05-04  Peng Liu  <peng.liu6@apple.com>
2290
2291         Fix the mistake on macro HAVE_SYSTEM_FEATURE_FLAGS
2292         https://bugs.webkit.org/show_bug.cgi?id=211416
2293
2294         Reviewed by Tim Horton.
2295
2296         We should use "#if HAVE(SYSTEM_FEATURE_FLAGS)" instead of "#if HAVE(HAVE_SYSTEM_FEATURE_FLAGS)".
2297         And we have to use the function _os_feature_enabled_impl() instead of the macro os_feature_enabled()
2298         because WebKit is a namespace and cannot be used in os_feature_enabled().
2299
2300         * Shared/WebPreferencesDefaultValues.cpp:
2301         (WebKit::defaultAsyncFrameAndOverflowScrollingEnabled):
2302         (WebKit::defaultUseGPUProcessForMedia):
2303         (WebKit::defaultRenderCanvasInGPUProcessEnabled):
2304         (WebKit::defaultCaptureAudioInGPUProcessEnabled):
2305         (WebKit::defaultCaptureVideoInGPUProcessEnabled):
2306         (WebKit::defaultWebRTCCodecsInGPUProcess):
2307         (WebKit::defaultWebGL2Enabled):
2308         (WebKit::defaultWebGPUEnabled):
2309         (WebKit::defaultInAppBrowserPrivacy):
2310         (WebKit::defaultIncrementalPDFEnabled):
2311         (WebKit::defaultWebXREnabled):
2312
2313 2020-05-04  Brent Fulgham  <bfulgham@apple.com>
2314
2315         [macOS] Eliminate SecurityServer and OCSPD from the WebContent sandbox
2316         https://bugs.webkit.org/show_bug.cgi?id=211417
2317         <rdar://problem/46235370>
2318
2319         Reviewed by Per Arne Vollan.
2320
2321         We can now re-block access to these services.
2322
2323         * WebProcess/com.apple.WebProcess.sb.in:
2324
2325 2020-05-04  Timothy Horton  <timothy_horton@apple.com>
2326
2327         Unreviewed, reverting r261117.
2328
2329         Broke lots of API tests
2330
2331         Reverted changeset:
2332
2333         "Excessive error logging from daemons trying to use WebKit,
2334         under -[UIDevice currentDevice]"
2335         https://bugs.webkit.org/show_bug.cgi?id=211397
2336         https://trac.webkit.org/changeset/261117
2337
2338 2020-05-04  Darin Adler  <darin@apple.com>
2339
2340         [Cocoa] Remove a few unneeded __IPHONE_OS_VERSION_MIN_REQUIRED checks
2341         https://bugs.webkit.org/show_bug.cgi?id=211383
2342
2343         Reviewed by Alexey Proskuryakov.
2344
2345         * UIProcess/ios/forms/WKAirPlayRoutePicker.h: Removed a check against
2346         iOS 11, in code that already explicitly checks for watchOS and tvOS.
2347
2348 2020-05-04  Darin Adler  <darin@apple.com>
2349
2350         Remove HAVE(IOSURFACE) checks in Cocoa-platform-specific code
2351         https://bugs.webkit.org/show_bug.cgi?id=211389
2352
2353         Reviewed by Alexey Proskuryakov.
2354
2355         * GPUProcess/webrtc/LibWebRTCCodecsProxy.mm:
2356         (WebKit::LibWebRTCCodecsProxy::encodeFrame): Remove HAVE(IOSURFACE) since
2357         this is Cocoa-specific code.
2358         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
2359         (WebKit::RemoteLayerBackingStore::ensureBackingStore): Ditto.
2360         (WebKit::RemoteLayerBackingStore::clearBackingStore): Ditto.
2361         (WebKit::RemoteLayerBackingStore::encode const): Ditto.
2362         (WebKit::RemoteLayerBackingStore::decode): Ditto.
2363         (WebKit::RemoteLayerBackingStore::bytesPerPixel const): Ditto.
2364         (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer): Ditto.
2365         (WebKit::RemoteLayerBackingStore::display): Ditto.
2366         (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer): Ditto.
2367         (WebKit::RemoteLayerBackingStore::setBufferVolatility): Ditto.
2368         (WebKit::RemoteLayerBackingStore::Buffer::discard): Ditto.
2369         (WebKit::RemoteLayerBackingStore::surfaceBufferFormat const): Ditto.
2370         * UIProcess/API/ios/WKWebViewIOS.mm:
2371         (-[WKWebView _takeViewSnapshot]): Ditto.
2372         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): Ditto.
2373         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: Ditto.
2374         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
2375         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy): Ditto.
2376         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
2377         (WebKit::recursivelyMapIOSurfaceBackingStore): Ditto.
2378         (WebKit::RemoteLayerTreeHost::mapAllIOSurfaceBackingStore): Ditto.
2379         * WebProcess/GPU/graphics/cocoa/ImageBufferShareableIOSurfaceBackend.cpp: Ditto.
2380         * WebProcess/GPU/graphics/cocoa/ImageBufferShareableIOSurfaceBackend.h: Ditto.
2381         * WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp:
2382         (WebKit::MediaRecorderPrivate::sampleBufferUpdated): Ditto.
2383         * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
2384         (WebKit::LibWebRTCProvider::createDecoderFactory): Ditto.
2385         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
2386         (WebKit::UserMediaCaptureManager::Source::remoteVideoSampleAvailable): Ditto.
2387         (WebKit::UserMediaCaptureManager::remoteVideoSampleAvailable): Ditto.
2388
2389 2020-05-04  David Kilzer  <ddkilzer@apple.com>
2390
2391         Use default constructor and default initializer for SecItemRequestData
2392         <https://webkit.org/b/211399>
2393         <rdar://problem/62861551>
2394
2395         Reviewed by Darin Adler.
2396
2397         * Shared/mac/SecItemRequestData.cpp:
2398         - Remove default constructor implementation.
2399         * Shared/mac/SecItemRequestData.h:
2400         - Use default constructor for class.
2401         - Use default initializer for m_type.
2402
2403 2020-05-04  Brent Fulgham  <bfulgham@apple.com>
2404
2405         REGRESSION (r259470): Accessibility Stereo to Mono is not working
2406         https://bugs.webkit.org/show_bug.cgi?id=211408
2407         <rdar://problem/62847299>
2408
2409         Reviewed by Per Arne Vollan.
2410
2411         The changes in r259470 regressed our Accessibility features. We need to do a rollout of that
2412         change to restore proper behavior.
2413
2414         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2415         * WebProcess/com.apple.WebProcess.sb.in:
2416
2417 2020-05-04  Jiewen Tan  <jiewen_tan@apple.com>
2418
2419         [WebAuthn] Implement +[_WKWebAuthenticationPanel clearAllLocalAuthenticatorCredentials]
2420         https://bugs.webkit.org/show_bug.cgi?id=211369
2421         <rdar://problem/60246635>
2422
2423         Reviewed by Brent Fulgham.
2424
2425         Adds a new SPI for UI clients to clear all existing credentials from the keychain.
2426
2427         * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h:
2428         * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm:
2429         (+[_WKWebAuthenticationPanel clearAllLocalAuthenticatorCredentials]):
2430         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.h:
2431         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
2432         (WebKit::LocalAuthenticator::clearAllCredentials):
2433         * UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
2434         (WebKit::LocalConnection::createCredentialPrivateKey const):
2435
2436 2020-05-04  Tim Horton  <timothy_horton@apple.com>
2437
2438         Excessive error logging from daemons trying to use WebKit, under -[UIDevice currentDevice]
2439         https://bugs.webkit.org/show_bug.cgi?id=211397
2440         <rdar://problem/61635403>
2441
2442         Reviewed by Simon Fraser.
2443
2444         * Shared/UserInterfaceIdiom.mm:
2445         (WebKit::userInterfaceIdiomIsPad):
2446         Adjust userInterfaceIdiomIsPad so that in daemons, it consults only MobileGestalt,
2447         which returns the actual hardware model, and does not try to use UIDevice.
2448         UIDevice is more accurate for applications because it will report that
2449         the device is an iPhone when called inside an iPhone app running on iPad,
2450         but it cannot be used in daemons that do not have a UIApplication.
2451         
2452         For the behaviors we gate on this bit, it makes sense to use iPhone
2453         behaviors on iPad in the iPhone app jail, so we continue using
2454         UIDevice if possible.
2455
2456         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2457         (-[WKWebViewConfiguration init]):
2458         Make use of the new mechanism instead of going straight to MobileGestalt,
2459         for the aforementioned reasons.
2460
2461 2020-05-04  Chris Dumez  <cdumez@apple.com>
2462
2463         Stop hard-coding get-task-allow entitlement for simulator builds
2464         https://bugs.webkit.org/show_bug.cgi?id=211392
2465
2466         Reviewed by Geoffrey Garen.
2467
2468         Stop hard-coding get-task-allow entitlement for simulator builds and let Xcode inject it as needed.
2469
2470         * Configurations/BaseXPCService.xcconfig:
2471         * Resources/ios/XPCService-embedded-simulator.entitlements:
2472
2473 2020-05-04  Brent Fulgham  <bfulgham@apple.com>
2474
2475         REGRESSION (JazzkonE): ResourceLoadStatisticsDatabaseStore checks 'hasHadUserInteraction' without ensuring the domain has been added to the ITP database (211388)
2476         https://bugs.webkit.org/show_bug.cgi?id=211388
2477         <rdar://problem/62849919>
2478
2479         Reviewed by John Wilander.
2480
2481         A spurious log entry is created if we check 'hasHadUserInteraction' before inserting a row for the domain
2482         being checked (if that domain had not previosly been observed). This patch changes the order of the two
2483         commands to avoid this possibility. This makes the database implementation behave like the in-memory version.
2484
2485         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
2486         (WebKit::ResourceLoadStatisticsDatabaseStore::logUserInteraction):
2487
2488 2020-05-04  Alex Christensen  <achristensen@webkit.org>
2489
2490         Reduce AlternativeService assertion to debug-only assert
2491         https://bugs.webkit.org/show_bug.cgi?id=211263
2492         <rdar://problem/61354813>
2493
2494         Reviewed by Chris Dumez.
2495
2496         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2497         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2498         This is asserting sometimes.  No need to crash.  Reduce to debug-only assert.
2499
2500 2020-05-04  Said Abou-Hallawa  <sabouhallawa@apple.com>
2501
2502         Throttling requestAnimationFrame should be controlled by RenderingUpdateScheduler
2503         https://bugs.webkit.org/show_bug.cgi?id=204713
2504
2505         Reviewed by Simon Fraser.
2506
2507         Create an IPC message on the DrawingArea to send a message from the
2508         WebProcess to the UIProcess to setPreferredFramesPerSecond of the
2509         DisplayRefreshMonitor.
2510
2511         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
2512         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in:
2513         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
2514         (-[WKOneShotDisplayLinkHandler setPreferredFramesPerSecond:]):
2515         (WebKit::RemoteLayerTreeDrawingAreaProxy::setPreferredFramesPerSecond):
2516         Set the preferredFramesPerSecond of the CADisplayLink.
2517
2518         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.h:
2519         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm:
2520         (WebKit::RemoteLayerTreeDisplayRefreshMonitor::setPreferredFramesPerSecond):
2521         Forward the call to RemoteLayerTreeDrawingArea.
2522
2523         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
2524         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
2525         (WebKit::RemoteLayerTreeDrawingArea::setPreferredFramesPerSecond):
2526         Send the IPC message from the WebProcess to the UIProcess.
2527
2528 2020-05-04  Alex Christensen  <achristensen@webkit.org>
2529
2530         TestWebKitAPI.WebKit.CustomDisplayName is a flaky timeout
2531         https://bugs.webkit.org/show_bug.cgi?id=211299
2532
2533         Reviewed by Chris Dumez.
2534
2535         Sometimes the task queued in WebProcess::updateProcessName happens after the one in WebProcess::updateActivePages.
2536         Schedule them on the same queue so they happen in deterministic order so we get reliable process names eventually.
2537
2538         * WebProcess/cocoa/WebProcessCocoa.mm:
2539         (WebKit::WebProcess::updateActivePages):
2540
2541 2020-05-04  Brent Fulgham  <bfulgham@apple.com>
2542
2543         Remove unneeded check for Apple Media Services
2544         https://bugs.webkit.org/show_bug.cgi?id=211391
2545         <rdar://problem/62853199>
2546
2547         Reviewed by Per Arne Vollan.
2548
2549         Earlier in the development cycle we added an entitlement check for AppleMediaServices, that we now realize
2550         we do not need. Since this is a non-zero performance cost, remove this check.
2551
2552         * UIProcess/WebPageProxy.cpp:
2553
2554 2020-05-04  Devin Rousso  <drousso@apple.com>
2555
2556         Web Inspector: provide a way for inspector to turn on/off ITP debug mode and AdClickAttribution debug mode
2557         https://bugs.webkit.org/show_bug.cgi?id=209763
2558
2559         Reviewed by Brian Burg.
2560
2561         Generalize the `setMockCaptureDevicesEnabledOverride` to be `setDeveloperPreferenceOverride`
2562         that uses an enum `WebCore::InspectorClient::DeveloperPreference` to know what to do.
2563
2564         Communicate with the NetworkProcess (from the WebProcess via the UIProcess) in the case of:
2565          - `AdClickAttributionDebugModeEnabled`
2566          - `ITPDebugModeEnabled`
2567
2568         * WebProcess/Inspector/WebInspectorClient.h:
2569         * WebProcess/Inspector/WebInspectorClient.cpp:
2570         (WebKit::WebInspectorClient::setDeveloperPreferenceOverride): Added.
2571         (WebKit::WebInspectorClient::setMockCaptureDevicesEnabledOverride): Deleted.
2572         * WebProcess/Inspector/WebInspector.h:
2573         * WebProcess/Inspector/WebInspector.cpp:
2574         (WebKit::WebInspector::setDeveloperPreferenceOverride): Added.
2575         (WebKit::WebInspector::setMockCaptureDevicesEnabledOverride): Deleted.
2576
2577         * UIProcess/Inspector/WebInspectorProxy.messages.in:
2578         * UIProcess/Inspector/WebInspectorProxy.h:
2579         * UIProcess/Inspector/WebInspectorProxy.cpp:
2580         (WebKit::WebInspectorProxy::setDeveloperPreferenceOverride): Added.
2581         (WebKit::WebInspectorProxy::setMockCaptureDevicesEnabledOverride): Deleted.
2582         * UIProcess/WebsiteData/WebsiteDataStore.h:
2583         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2584         (WebKit::WebsiteDataStore::setAdClickAttributionDebugMode): Added.
2585         * UIProcess/Network/NetworkProcessProxy.h:
2586         * UIProcess/Network/NetworkProcessProxy.cpp:
2587         (WebKit::NetworkProcessProxy::setAdClickAttributionDebugMode): Added.
2588
2589         * NetworkProcess/NetworkProcess.messages.in:
2590         * NetworkProcess/NetworkProcess.h:
2591         * NetworkProcess/NetworkProcess.cpp:
2592         (WebKit::NetworkProcess::initializeNetworkProcess):
2593         (WebKit::NetworkProcess::setAdClickAttributionDebugMode): Added.
2594         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
2595         (WebKit::ResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
2596
2597 2020-05-04  Chris Dumez  <cdumez@apple.com>
2598
2599         [iOS] Unable to take RunningBoard process assertions in the iOS Simulator
2600         https://bugs.webkit.org/show_bug.cgi?id=211254
2601         <rdar://problem/62674074>
2602
2603         Reviewed by Geoffrey Garen.
2604
2605         Add com.apple.runningboard.assertions.webkit entitlement to iOS Simulator builds so that
2606         we can take RunningBoard assertions on those platforms too.
2607
2608         While doing this, I found that we were not adding the entitlements properly for simulator
2609         builds. For simulator builds, entitlements go into an __entitlements section of the binary,
2610         rather than in the signature. Use CODE_SIGN_ENTITLEMENTS directive in xcconfig so that
2611         XCode does the right thing for simulator builds.
2612
2613         * Configurations/BaseXPCService.xcconfig:
2614         * Resources/ios/XPCService-embedded-simulator.entitlements: Added.
2615         * Scripts/process-entitlements.sh:
2616
2617 2020-05-04  Darin Adler  <darin@apple.com>
2618
2619         Remove now-unneded HAVE(WINDOW_SERVER_OCCLUSION_NOTIFICATIONS)
2620         https://bugs.webkit.org/show_bug.cgi?id=211380
2621
2622         Reviewed by Sam Weinig.
2623
2624         * UIProcess/mac/WindowServerConnection.h: Don't check
2625         HAVE(WINDOW_SERVER_OCCLUSION_NOTIFICATIONS) in this Mac-only header.
2626         Also removed #pragma once in this header that is only included from .mm files.
2627
2628         * UIProcess/mac/WindowServerConnection.mm: Wrapped the whole file in
2629         PLATFORM(MAC) because this is macOS-specific code that may be compiled on
2630         iOS family platforms. Could wrap it in HAVE(WINDOW_SERVER) instead, but we
2631         don't have anything like that and PageClientImplMac.mm, the client of this
2632         code, uses PLATFORM(MAC).
2633         (WebKit::registerOcclusionNotificationHandler): Ditto.
2634         (WebKit::WindowServerConnection::WindowServerConnection): Ditto.
2635
2636 2020-05-04  Darin Adler  <darin@apple.com>
2637
2638         Remove now-unneeded HAVE(UI_REMOTE_VIEW)
2639         https://bugs.webkit.org/show_bug.cgi?id=211382
2640
2641         Reviewed by Alex Christensen.
2642
2643         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
2644         (WebKit::createRemoteView): Deleted.
2645         (WebKit::RemoteLayerTreeHost::makeNode): After researching to be sure the method
2646         is present in the relevant versions of iOS 13, changed this code to use the
2647         initWithFrame:pid:contextID: method without doing a selector check, and also
2648         without a HAVE(UI_REMOTE_VIEW) conditional.
2649
2650         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm: Removed the
2651         HAVE(UI_REMOTE_VIEW) conditional.
2652
2653 2020-05-04  Darin Adler  <darin@apple.com>
2654
2655         Remove now-unneeded HAVE(MENU_CONTROLLER_SHOW_HIDE_API)
2656         https://bugs.webkit.org/show_bug.cgi?id=211381
2657
2658         Reviewed by Alex Christensen.
2659
2660         * UIProcess/ios/WKContentViewInteraction.mm:
2661         (-[WKContentView _handleDOMPasteRequestWithResult:]): Use hideMenuFromView: directly.
2662         (-[WKContentView _requestDOMPasteAccessWithElementRect:originIdentifier:completionHandler:]):
2663         Use showMenuFromView: directly.
2664         (-[WKContentView showGlobalMenuControllerInRect:]): Deleted.
2665         (-[WKContentView hideGlobalMenuController]): Deleted.
2666
2667 2020-05-04  Darin Adler  <darin@apple.com>
2668
2669         Remove now-unneeded HAVE(VOUCHERS)
2670         https://bugs.webkit.org/show_bug.cgi?id=211379
2671
2672         Reviewed by Alex Christensen.
2673
2674         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
2675         (WebKit::XPCServiceInitializer): Remove HAVE(VOUCHERS) checks from this
2676         Cocoa-only source file.
2677
2678 2020-05-04  Alex Christensen  <achristensen@webkit.org>
2679
2680         TestWebKitAPI.WebKit.CustomDisplayName is a flaky timeout
2681         https://bugs.webkit.org/show_bug.cgi?id=211299
2682
2683         Reviewed by Darin Adler.
2684
2685         The application name is being set on a background queue, but there's nothing actually keeping the NSString alive.
2686         This may fix some timeouts we were seeing.  I wonder why ASAN or guard malloc didn't catch this yet.
2687
2688         * WebProcess/cocoa/WebProcessCocoa.mm:
2689         (WebKit::WebProcess::updateProcessName):
2690
2691 2020-05-04  Darin Adler  <darin@apple.com>
2692
2693         Remove no-longer-needed HAVE(UISCENE)
2694         https://bugs.webkit.org/show_bug.cgi?id=211376
2695
2696         Reviewed by Chris Dumez.
2697
2698         * Platform/spi/ios/UIKitSPI.h: Don't check HAVE(UISCENE) any more in this
2699         iOS-family-only source file; it's always true.
2700         * UIProcess/ApplicationStateTracker.h: Ditto.
2701         * UIProcess/ApplicationStateTracker.mm:
2702         (WebKit::ApplicationStateTracker::ApplicationStateTracker): Ditto.
2703         (WebKit::ApplicationStateTracker::~ApplicationStateTracker): Ditto.
2704         * UIProcess/ios/WKContentView.mm:
2705         (-[WKContentView interfaceOrientation]): Ditto.
2706         * UIProcess/ios/WKContentViewInteraction.mm:
2707         (-[WKContentView textEffectsWindow]): Ditto.
2708
2709 2020-05-04  Yusuke Suzuki  <ysuzuki@apple.com>
2710
2711         Unreviewed, speculative build fix for r261071
2712         https://bugs.webkit.org/show_bug.cgi?id=211274
2713
2714         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2715
2716 2020-05-04  Emilio Cobos Álvarez  <emilio@crisal.io>
2717
2718         Put lh / rlh units behind a flag until bug 211351 is sorted out.
2719         https://bugs.webkit.org/show_bug.cgi?id=211356
2720
2721         Reviewed by Antti Koivisto.
2722
2723         * Shared/WebPreferences.yaml: Define the runtime flag.
2724
2725 2020-05-03  David Kilzer  <ddkilzer@apple.com>
2726
2727         Use LocalCurrentGraphicsContext in WebKit::convertPlatformImageToBitmap()
2728         <https://webkit.org/b/211274>
2729
2730         Reviewed by Darin Adler.
2731
2732         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2733         (WebKit::convertPlatformImageToBitmap):
2734         - Use LocalCurrentGraphicsContext to replace code.
2735
2736 2020-05-03  David Kilzer  <ddkilzer@apple.com>
2737
2738         Use default initializers and default constructors in WebEvent.h
2739         <https://webkit.org/b/211354>
2740
2741         Reviewed by Daniel Bates.
2742
2743         * Shared/WebEvent.h:
2744         (WebKit::WebWheelEvent):
2745         (WebKit::WebKeyboardEvent):
2746         (WebKit::WebPlatformTouchPoint):
2747         (WebKit::WebTouchEvent):
2748         - Change empty constructors to use `default`.
2749         - Use default initializers to make sure all fields are
2750           initialized.
2751
2752 2020-05-02  Simon Fraser  <simon.fraser@apple.com>
2753
2754         handleWheelEventPhase() should include the relevant ScrollingNodeID
2755         https://bugs.webkit.org/show_bug.cgi?id=211315
2756
2757         Reviewed by Tim Horton.
2758
2759         handleWheelEventPhase() is used to send information about wheel event phases
2760         to the main thread, which make their way to ScrollAnimatorMac::handleWheelEventPhase()
2761         and are used to update the state of overlay scrollbars. In order to talk to the
2762         correct set of scrollbars with overflow:scroll, we need to send along the ScrollingNodeID
2763         and map that to the appropriate ScrollableArea.
2764
2765         Will be tested by future overlay scrollbar tests.
2766
2767         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
2768         (WebKit::RemoteScrollingTree::handleWheelEventPhase):
2769         * UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
2770
2771 2020-05-02  Carlos Garcia Campos  <cgarcia@igalia.com>
2772
2773         [GTK4] Re-inject key press events not handled by the web process
2774         https://bugs.webkit.org/show_bug.cgi?id=211286
2775
2776         Reviewed by Adrian Perez de Castro.
2777
2778         Use gdk_display_put_event() since gtk_main_do_event() is no longer available in GTK4. Also stop forwarding key
2779         release events in GTK3 case, this only makes sense for key press events and we were re-injecting every release
2780         event since they are not handled by web elements in most of the cases.
2781
2782         * UIProcess/API/gtk/PageClientImpl.cpp:
2783         (WebKit::PageClientImpl::doneWithKeyEvent):
2784         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2785         (webkitWebViewBaseKeyPressEvent):
2786         (webkitWebViewBaseKeyReleaseEvent):
2787         (webkitWebViewBaseKeyPressed):
2788
2789 2020-05-02  Adrian Perez de Castro  <aperez@igalia.com>
2790
2791         [GTK] Specify action group name when binding context menu models
2792         https://bugs.webkit.org/show_bug.cgi?id=211288
2793
2794         Reviewed by Carlos Garcia Campos.
2795
2796         No new tests needed.
2797
2798         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
2799         (WebKit::WebContextMenuProxyGtk::append): Use the action name directly for the menu item.
2800         (WebKit::WebContextMenuProxyGtk::populate): Indicate the action group name when binding the
2801         menu model, which automatically adds the group name as action name prefix without needing
2802         to specify it by hand when adding menu items.
2803
2804 2020-05-02  Devin Rousso  <drousso@apple.com>
2805
2806         [CSS Easing 1] implement `jump-*` step positions
2807         https://bugs.webkit.org/show_bug.cgi?id=211271
2808
2809         Reviewed by Dean Jackson.
2810
2811         * Shared/WebCoreArgumentCoders.cpp:
2812         (IPC::ArgumentCoder<StepsTimingFunction>::encode):
2813         (IPC::ArgumentCoder<StepsTimingFunction>::decode):
2814
2815 2020-05-01  Tim Horton  <timothy_horton@apple.com>
2816
2817         Books sometimes ends up with blank pages, especially after adjusting font size
2818         https://bugs.webkit.org/show_bug.cgi?id=211265
2819         <rdar://problem/59898144>
2820
2821         Reviewed by Darin Adler.
2822
2823         A few problems:
2824
2825         - There is short time during page creation where a WKWebView created
2826         with _clipsToVisibleRect=YES would not yet have sent its viewExposedRect
2827         to the Web Content process, and if we end up constructing tiles during
2828         that time, we can make way too many, bogging down the process (or crashing).
2829
2830         Fix this by always keeping track of the viewExposedRect (on WebPageProxy,
2831         instead of the somewhat-more-transient DrawingAreaProxy) and sending it
2832         to the Web Content process in the WebPage creation parameters, to entirely
2833         remove this window.
2834
2835         - Even when the viewExposedRect successfully gets to the Web Content
2836         process, it can still end up wildly wrong: the DrawingArea was tasked with
2837         watching scrolling changes, applying the scroll offset to the viewExposedRect,
2838         and pushing it to FrameView in content coordinates.
2839
2840         It turns out that this was all unnecessary, as we need viewExposedRect
2841         in root view coordinates (same space as visibleContentRect, which we
2842         intersect it with), and we just didn't notice because all clients of
2843         _clipsToVisibleRect: expand the view to its layout size and insert
2844         a scrolling view outside the web view, and so don't use our scrolling.
2845
2846         Avoid this conversion and complexity entirely; I tested Mail and Books
2847         where there is no impact (other than fixing the original bug), and also
2848         a custom test app with a scrollable WKWebView inside a NSScrollView,
2849         which improved significantly.
2850
2851         * Shared/WebPageCreationParameters.cpp:
2852         (WebKit::WebPageCreationParameters::encode const):
2853         (WebKit::WebPageCreationParameters::decode):
2854         * Shared/WebPageCreationParameters.h:
2855         Plumb view exposed rect via WebPage creation parameters.
2856
2857         * UIProcess/Cocoa/WebViewImpl.mm:
2858         (WebKit::WebViewImpl::updateViewExposedRect):
2859         Send viewExposedRect changes to WebPageProxy instead of DrawingAreaProxy.
2860
2861         * UIProcess/DrawingAreaProxy.cpp:
2862         (WebKit::DrawingAreaProxy::didChangeViewExposedRect):
2863         (WebKit::DrawingAreaProxy::viewExposedRectChangedTimerFired):
2864         (WebKit::DrawingAreaProxy::setViewExposedRect): Deleted.
2865         * UIProcess/DrawingAreaProxy.h:
2866         (WebKit::DrawingAreaProxy::viewExposedRect const): Deleted.
2867         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
2868         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
2869         (WebKit::RemoteLayerTreeDrawingAreaProxy::didChangeViewExposedRect):
2870         (WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation const):
2871         (WebKit::RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator):
2872         (WebKit::RemoteLayerTreeDrawingAreaProxy::setViewExposedRect): Deleted.
2873         * UIProcess/WebPageProxy.cpp:
2874         (WebKit::WebPageProxy::setViewExposedRect):
2875         * UIProcess/WebPageProxy.h:
2876         (WebKit::WebPageProxy::viewExposedRect const):
2877         Maintain viewExposedRect on WebPageProxy instead of DrawingAreaProxy,
2878         so that we can always store it even if we don't have a DrawingAreaProxy yet
2879         (or change DrawingAreaProxies) and can send it in WebPage creation parameters.
2880
2881         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
2882         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
2883         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
2884         (WebKit::RemoteLayerTreeDrawingArea::setViewExposedRect):
2885         (WebKit::RemoteLayerTreeDrawingArea::updateRendering):
2886         (WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect): Deleted.
2887         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2888         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2889         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
2890         (WebKit::TiledCoreAnimationDrawingArea::updateRendering):
2891         (WebKit::TiledCoreAnimationDrawingArea::setViewExposedRect):
2892         (WebKit::TiledCoreAnimationDrawingArea::scroll): Deleted.
2893         (WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect): Deleted.
2894         Plumb viewExposedRect directly to FrameView, instead of trying to apply
2895         the root view -> contents mapping ourselves and pushing updates.
2896
2897 2020-05-01  David Kilzer  <ddkilzer@apple.com>
2898
2899         [IPC hardening] Refactor createMessageDecoder() for clarity
2900         <https://webkit.org/b/211322>
2901
2902         Reviewed by Darin Adler.
2903
2904         * Platform/IPC/cocoa/ConnectionCocoa.mm:
2905         (IPC::createMessageDecoder):
2906         - Rename `numDescriptors` to `numberOfPortDescriptors` to match
2907           variable name in sendOutgoingMessage().
2908         - Add new `numberOfAttachments` variable to make it clear that
2909           one port descriptor is left for an out-of-line message body.
2910         - Add FIXME about another issue.
2911
2912 2020-05-01  Alex Christensen  <achristensen@webkit.org>
2913
2914         Add SPI to move localStorage to a different domain
2915         https://bugs.webkit.org/show_bug.cgi?id=209260
2916         <rdar://problem/60285683>
2917
2918         Reviewed by Brady Eidson.
2919
2920         Covered by an API test.
2921
2922         * NetworkProcess/NetworkProcess.cpp:
2923         (WebKit::NetworkProcess::renameDomainInWebsiteData):
2924         (WebKit::NetworkProcess::getLocalStorageOriginDetails):
2925         * NetworkProcess/NetworkProcess.h:
2926         * NetworkProcess/NetworkProcess.messages.in:
2927         * NetworkProcess/WebStorage/LocalStorageNamespace.cpp:
2928         (WebKit::LocalStorageNamespace::renameDomain):
2929         * NetworkProcess/WebStorage/LocalStorageNamespace.h:
2930         * NetworkProcess/WebStorage/StorageArea.cpp:
2931         (WebKit::StorageArea::close):
2932         * NetworkProcess/WebStorage/StorageArea.h:
2933         * NetworkProcess/WebStorage/StorageManager.cpp:
2934         (WebKit::StorageManager::renameDomain):
2935         * NetworkProcess/WebStorage/StorageManager.h:
2936         * NetworkProcess/WebStorage/StorageManagerSet.cpp:
2937         (WebKit::StorageManagerSet::renameDomain):
2938         * NetworkProcess/WebStorage/StorageManagerSet.h:
2939         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2940         (-[WKWebsiteDataStore _renameDomain:to:forDataOfTypes:completionHandler:]):
2941         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2942         * UIProcess/Network/NetworkProcessProxy.cpp:
2943         (WebKit::NetworkProcessProxy::renameDomainInWebsiteData):
2944         * UIProcess/Network/NetworkProcessProxy.h:
2945         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2946         (WebKit::WebsiteDataStore::renameDomainInWebsiteData):
2947         * UIProcess/WebsiteData/WebsiteDataStore.h:
2948
2949 2020-05-01  Chris Dumez  <cdumez@apple.com>
2950
2951         [iOS] ProcessThrottler fails to re-take ProcessAssertion if the previous one was invalidated
2952         https://bugs.webkit.org/show_bug.cgi?id=211297
2953         <rdar://problem/62542463>
2954
2955         Reviewed by Jer Noble.
2956
2957         Our ProcessAssertions may get invalidated upon backgrounding of the app. When the app becomes
2958         foreground and the ProcessThrottler tries to take a Foreground assertion as a result, it would
2959         incorrectly think it already had such assertion and not do anything, even though the previous
2960         one is no longer valid. As a result, the child processes would stay suspended even though the
2961         app was foregrounded.
2962
2963         To address the issue, add a isValid() method to ProcessAssertion() and check it in
2964         ProcessThrottler::setAssertionType() to determine if we need to re-take an assertion or not.
2965         We also invalidate all pending ProcessThrottler activities upon ProcessAssertion invalidation
2966         for good measure. This way, the holders of these activities will be able to rely on
2967         Activity::isValid() to determine if they need to re-take their activities or not.
2968
2969         * Platform/spi/ios/AssertionServicesSPI.h:
2970         * Platform/spi/ios/RunningBoardServicesSPI.h:
2971         * UIProcess/ProcessAssertion.cpp:
2972         (WebKit::ProcessAssertion::isValid const):
2973         * UIProcess/ProcessAssertion.h:
2974         (WebKit::ProcessAssertion::validity const): Deleted.
2975         * UIProcess/ProcessThrottler.cpp:
2976         (WebKit::ProcessThrottler::setAssertionType):
2977         (WebKit::ProcessThrottler::assertionWasInvalidated):
2978         * UIProcess/ProcessThrottler.h:
2979         * UIProcess/ios/ProcessAssertionIOS.mm:
2980         (WebKit::ProcessAssertion::processAssertionWasInvalidated):
2981         (WebKit::ProcessAssertion::isValid const):
2982         (WebKit::ProcessAndUIAssertion::updateRunInBackgroundCount):
2983
2984 2020-05-01  Chris Dumez  <cdumez@apple.com>
2985
2986         Unreviewed, reverting r261015.
2987
2988         Seems to have broken clean builds
2989
2990         Reverted changeset:
2991
2992         "[iOS] Unable to take RunningBoard process assertions in the
2993         iOS Simulator"
2994         https://bugs.webkit.org/show_bug.cgi?id=211254
2995         https://trac.webkit.org/changeset/261015
2996
2997 2020-05-01  David Kilzer  <ddkilzer@apple.com>
2998
2999         [IPC hardening] createMessageDecoder() needs a validity check
3000         <https://webkit.org/b/211260>
3001         <rdar://problem/61914087>
3002
3003         Reviewed by Darin Adler.
3004
3005         * Platform/IPC/cocoa/ConnectionCocoa.mm:
3006         (IPC::createMessageDecoder):
3007         - Add validity check and early return for
3008           `numDescriptors`.
3009
3010 2020-05-01  Devin Rousso  <drousso@apple.com>
3011
3012         Web Inspector: Browser: crash when handling `disable`
3013         https://bugs.webkit.org/show_bug.cgi?id=211251
3014
3015         Reviewed by Daniel Bates.
3016
3017         * UIProcess/Inspector/Agents/InspectorBrowserAgent.cpp:
3018         (WebKit::InspectorBrowserAgent::disable):
3019         If the inspected page crashed, we won't have a `WebInspectorProxy` anymore.
3020
3021 2020-05-01  Per Arne Vollan  <pvollan@apple.com>
3022
3023         [iOS] Every running WebContent process should be granted access to frontboard services when Accessibility is enabled
3024         https://bugs.webkit.org/show_bug.cgi?id=211238
3025
3026         Reviewed by Daniel Bates.
3027
3028         Currently, every WebContent process is granted access to frontboard services if Accessibility is enabled at the
3029         time of startup. However, WebContent processes running at the time when Accessibility is enabled are not granted
3030         access, which is a bug.
3031
3032         API test: WebKit.AccessibilityHasFrontboardServiceAccess
3033
3034         * UIProcess/AuxiliaryProcessProxy.cpp:
3035         (WebKit::AuxiliaryProcessProxy::sendMessage):
3036         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3037         (WebKit::WebProcessPool::platformInitializeWebProcess):
3038         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
3039         (WebKit::WebProcessProxy::unblockAccessibilityServerIfNeeded):
3040         * WebProcess/WebProcess.h:
3041         * WebProcess/WebProcess.messages.in:
3042         * WebProcess/cocoa/WebProcessCocoa.mm:
3043         (WebKit::WebProcess::unblockServicesRequiredByAccessibility):
3044         (WebKit::WebProcess::unblockAccessibilityServer): Deleted.
3045
3046 2020-05-01  Chris Dumez  <cdumez@apple.com>
3047
3048         [iOS] Unable to take RunningBoard process assertions in the iOS Simulator
3049         https://bugs.webkit.org/show_bug.cgi?id=211254
3050         <rdar://problem/62674074>
3051
3052         Reviewed by Tim Horton.
3053
3054         * Configurations/BaseXPCService.xcconfig:
3055         Use this directive to add our entitlements:
3056             CODE_SIGN_ENTITLEMENTS = $(WK_PROCESSED_XCENT_FILE);
3057         instead of using:
3058             OTHER_CODE_SIGN_FLAGS = --entitlements $(WK_PROCESSED_XCENT_FILE);
3059         This is important because entitlements are added differently for iOS Simulator builds,
3060         so that they only apply inside the simulator (and not for the host system). If we use
3061         CODE_SIGN_ENTITLEMENTS, then XCode does the right thing on all platforms.
3062
3063         * Scripts/process-entitlements.sh:
3064         Add com.apple.runningboard.assertions.webkit entitlement to iOS Simulator builds.
3065
3066 2020-05-01  Don Olmstead  <don.olmstead@sony.com>
3067
3068         [GTK] Add additional exports to support hidden visibility
3069         https://bugs.webkit.org/show_bug.cgi?id=211246
3070
3071         Reviewed by Michael Catanzaro.
3072
3073         * WebProcess/InjectedBundle/API/glib/WebKitWebExtensionPrivate.h:
3074
3075 2020-05-01  Per Arne Vollan  <pvollan@apple.com>
3076
3077         [iOS] Update message filtering rules in the WebContent process' sandbox
3078         https://bugs.webkit.org/show_bug.cgi?id=211188
3079         <rdar://problem/60922910>
3080
3081         Reviewed by Brent Fulgham.
3082
3083         Based on telemetry and local testing, update the message filtering rules in the WebContent process' sandbox on iOS.
3084         Messages that have not been observed being in use, should be denied.
3085
3086         No new tests, covered by existing tests.
3087
3088         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3089         * UIProcess/AuxiliaryProcessProxy.cpp:
3090         (WebKit::AuxiliaryProcessProxy::sendMessage):
3091
3092 2020-05-01  Peng Liu  <peng.liu6@apple.com>
3093
3094         A PiP window doesn’t actually dismiss after the browser navigates to a different page within the same domain
3095         https://bugs.webkit.org/show_bug.cgi?id=211257
3096
3097         Reviewed by Jer Noble.
3098
3099         Add the support of exitVideoFullscreenToModeWithoutAnimation() in iOS,
3100         so that the Web process can request the UI process to close the PiP window
3101         without exchanging IPC messages back and forth.
3102
3103         * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
3104         * UIProcess/Cocoa/VideoFullscreenManagerProxy.messages.in:
3105         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
3106         (WebKit::VideoFullscreenManagerProxy::exitFullscreenWithoutAnimationToMode):
3107         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3108         * WebProcess/WebCoreSupport/WebChromeClient.h:
3109
3110         Only stop the watchdog timer if it is active.
3111         * WebProcess/cocoa/VideoFullscreenManager.mm:
3112         (WebKit::VideoFullscreenManager::exitVideoFullscreenToModeWithoutAnimation):
3113
3114 2020-05-01  Commit Queue  <commit-queue@webkit.org>
3115
3116         Unreviewed, reverting r260920.
3117         https://bugs.webkit.org/show_bug.cgi?id=211292
3118
3119         Sandbox compile error is no longer an issue (Requested by
3120         perarne on #webkit).
3121
3122         Reverted changeset:
3123
3124         "Unreviewed sandbox compile fix."
3125         https://trac.webkit.org/changeset/260920
3126
3127 2020-05-01  Carlos Garcia Campos  <cgarcia@igalia.com>
3128
3129         [GTK] Move focus out of the web view when tab is pressed and there isn't a next element to focus
3130         https://bugs.webkit.org/show_bug.cgi?id=211283
3131
3132         Reviewed by Adrian Perez de Castro.
3133
3134         Implement API::UIClient::takeFocus() that is called when WebCore wants to focus the chrome.
3135
3136         * UIProcess/API/glib/WebKitUIClient.cpp:
3137
3138 2020-05-01  David Kilzer  <ddkilzer@apple.com>
3139
3140         REGRESSION (r260214): Leak of _WKTextInputContext in -[WKContentView _isTextInputContextFocused:]
3141         <https://webkit.org/b/211276>
3142         <rdar://problem/62696724>
3143
3144         Reviewed by Daniel Bates.
3145
3146         * UIProcess/ios/WKContentViewInteraction.mm:
3147         (-[WKContentView _focusTextInputContext:placeCaretAt:completionHandler:]):
3148         - Use RetainPtr<> to pass the copy of _WKTextInputContext into
3149           the block to fix the leak.
3150
3151 2020-05-01  Saam Barati  <sbarati@apple.com>
3152
3153         We can't cast toLength result to unsigned
3154         https://bugs.webkit.org/show_bug.cgi?id=211205
3155         <rdar://problem/62625562>
3156
3157         Reviewed by Yusuke Suzuki.
3158
3159         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
3160         (WebKit::NPJSObject::hasProperty):
3161         (WebKit::NPJSObject::getProperty):
3162         (WebKit::NPJSObject::removeProperty):
3163
3164 2020-05-01  Adrian Perez de Castro  <aperez@igalia.com>
3165
3166         [GTK4] Disable arrow on context menu popover
3167         https://bugs.webkit.org/show_bug.cgi?id=211241
3168
3169         Reviewed by Carlos Garcia Campos.
3170
3171         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
3172         (WebKit::WebContextMenuProxyGtk::WebContextMenuProxyGtk): Disable the menu popover arrow.
3173
3174 2020-04-30  Ross Kirsling  <ross.kirsling@sony.com>
3175
3176         TriState should be an enum class and use "Indeterminate" instead of "Mixed"
3177         https://bugs.webkit.org/show_bug.cgi?id=211268
3178
3179         Reviewed by Mark Lam.
3180
3181         * WebProcess/WebPage/WebPage.cpp:
3182         (WebKit::WebPage::validateCommand):
3183
3184         * WebProcess/WebPage/glib/WebPageGLib.cpp:
3185         (WebKit::WebPage::getPlatformEditorState const):
3186
3187 2020-04-30  Jiewen Tan  <jiewen_tan@apple.com>
3188
3189         [WebAuthn] Require user gestures for LocalAuthenticator
3190         https://bugs.webkit.org/show_bug.cgi?id=182893
3191         <rdar://problem/43357293>
3192
3193         Reviewed by Brent Fulgham.
3194
3195         Covered by API tests.
3196
3197         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
3198         (WebKit::AuthenticatorManager::filterTransports const):
3199         (WebKit::AuthenticatorManager::getTransports const):
3200         Checks UserGesture here. Since filterTransports will be overrided in mock testings,
3201         all mock tests don't require user gestures.
3202
3203         * UIProcess/WebAuthentication/WebAuthenticationRequestData.h:
3204         * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp:
3205         (WebKit::WebAuthenticatorCoordinatorProxy::makeCredential):
3206         (WebKit::WebAuthenticatorCoordinatorProxy::getAssertion):
3207         * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h:
3208         * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.messages.in:
3209         * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp:
3210         (WebKit::WebAuthenticatorCoordinator::makeCredential):
3211         (WebKit::WebAuthenticatorCoordinator::getAssertion):
3212         Adds user gesture corresponding fields.
3213
3214 2020-04-30  Wenson Hsieh  <wenson_hsieh@apple.com>
3215
3216         Unreviewed, fix the Mac Catalyst build after r260979
3217
3218         The presence of `_contextMenuInteraction` is conditional not only on `USE(UICONTEXTMENU)`, but also
3219         `HAVE(LINK_PREVIEW)`. Guard logic in `-deferringGestureRecognizer:shouldDeferOtherGestureRecognizer:` with the
3220         latter as well.
3221
3222         * UIProcess/ios/WKContentViewInteraction.mm:
3223         (-[WKContentView deferringGestureRecognizer:shouldDeferOtherGestureRecognizer:]):
3224
3225 2020-04-30  Simon Fraser  <simon.fraser@apple.com>
3226
3227         Clean up some EventHandler coordinate-related naming and fix ScrollableArea::lastKnownMousePosition() conversions
3228         https://bugs.webkit.org/show_bug.cgi?id=211259
3229
3230         Reviewed by Zalan Bujtas.
3231
3232         * Shared/WebEvent.h:
3233         (WebKit::WebMouseEvent::position const):
3234         * Shared/WebMouseEvent.cpp:
3235         (WebKit::WebMouseEvent::WebMouseEvent):
3236         * WebProcess/Plugins/PDF/PDFPlugin.h:
3237
3238 2020-04-30  David Kilzer  <ddkilzer@apple.com>
3239
3240         [iOS] Fix confusing idiom for releasing _selectionRects in -[WKTextRange dealloc]
3241         <https://webkit.org/b/211269>
3242
3243         Reviewed by Wenson Hsieh.
3244
3245         * UIProcess/ios/WKContentViewInteraction.mm:
3246         (-[WKTextRange dealloc]):
3247         - Switch to more common idiom to release an instance variable.
3248           This fixes a false positive warning from the clang static
3249           analyzer about releasing a variable not owned by the caller.
3250
3251 2020-04-30  Wenson Hsieh  <wenson_hsieh@apple.com>
3252
3253         REGRESSION: Double tap dispatches one click event on iOS 13.4 when it would dispatch two on iOS 13.3
3254         https://bugs.webkit.org/show_bug.cgi?id=211179
3255         <rdar://problem/62594779>
3256
3257         Reviewed by Tim Horton.
3258
3259         https://trac.webkit.org/r253267 introduced deferring gesture recognizers as a way to handle preventable (non-
3260         passive) touchstart events without blocking the UI process. These deferring gesture recognizers work by having
3261         other gesture recognizers at or below WKWebView (with few exceptions) require the failure of these deferring
3262         gestures. These gestures transition to possible state when beginning a touch inside a non-passive touch event
3263         handling region, and transition to either failed or ended state (depending on whether `preventDefault()` was
3264         called) after the web content process finished handling the touch event.
3265
3266         However, this means that the resulting dependency graph now has an edge between each gesture under WKWebView and
3267         one of the deferring gesture recognizers, due to these new failure requirements. Since gestures that have been
3268         recognized or have failed don't get reset until all other gestures in the same dependency subgraph have also
3269         recognized or failed, some gestures (such as the synthetic single tap gesture recognizer in this bug) might not
3270         be resetting as soon after ending as they did before, since they may be connected to other gesture recognizers
3271         that are still in possible state by way of the failure requirements added by the new deferring gestures.
3272
3273         I was already aware of this problem in r253267, and attempted to solve this by bisecting the gesture dependency
3274         graph into two subgraphs: one containing all the one-finger multi-tap gestures that are reset after a lengthy
3275         delay, and another containing everything else. To do this, I added two different deferring gesture recognizers:
3276         one for immediately resettable gestures (meant for gestures in the latter subgraph), and another for gestures
3277         that are reset after a delay (meant for gestures in the former subgraph).
3278
3279         Unfortunately, unrelated changes around text interactions in UIKit in iOS 13.4 caused the tap-and-a-half
3280         gesture for selecting a range of text to now have a delayed reset; this means that gestures in the "immediately
3281         resettable" gesture subgraph are all forced to wait on the tap-and-a-half text interaction gesture before
3282         resetting, which causes the bug here, since the synthetic single tap gesture is in this "immediately resettable"
3283         gesture subgraph.
3284
3285         To mitigate this, this patch pushes the tap-and-a-half text selection gesture, along with the loupe gesture,
3286         context menu relationship gesture, and drag lift gestures (i.e. the other gestures that are connected to the
3287         tap-and-a-half gesture via failure requirements) out of the "immediately resettable" subgraph, and into the
3288         "delayed" subgraph.
3289
3290         Test: fast/events/touch/ios/two-click-events-after-double-tap-with-touch-handler.html
3291
3292         * Platform/spi/ios/UIKitSPI.h:
3293         * UIProcess/ios/WKContentViewInteraction.mm:
3294         (-[WKContentView deferringGestureRecognizer:shouldDeferOtherGestureRecognizer:]):
3295
3296 2020-04-30  Brent Fulgham  <bfulgham@apple.com>
3297
3298         REGRESSION (r260932): ASSERTION FAILED: ok in webkit::SandboxExtension::consumePermanently for 3 tests
3299         https://bugs.webkit.org/show_bug.cgi?id=211253
3300         <rdar://problem/62673727>
3301
3302         Reviewed by Per Arne Vollan.
3303
3304         In r260932 I added an assertion to confirm that a sandbox extension was successfully consumed. This triggered three
3305         test failures because those tests attempt to pass a sandbox extension from the WebContent process to the UIProcess.
3306
3307         After speaking with the Sandbox team, I learned that an unsandboxed program that attempts to consume a valid
3308         sandbox extension will return 0. Sandboxed processes either receive -1 (for error), or a handle representing the
3309         newly added extension (so that it can be removed when no longer needed).
3310         
3311         Since the TestWebKitAPI (and WebKitTestRunner) processes are not sandboxed they receive a zero return value here.
3312
3313         We should recognize this as a valid and expected result. We should also consider making some form of sandboxed
3314         driver for WebKit.
3315
3316         * Shared/Cocoa/SandboxExtensionCocoa.mm:
3317         (WebKit::SandboxExtensionImpl::consume): Recognize a 0 handle as valid.
3318
3319 2020-04-30  Jiewen Tan  <jiewen_tan@apple.com>
3320
3321         [WebAuthn] Optimize LocalAuthenticator
3322         https://bugs.webkit.org/show_bug.cgi?id=183534
3323         <rdar://problem/43357408>
3324
3325         Reviewed by Brent Fulgham.
3326
3327         This patch implements the following small optimizations:
3328         1. Replacing local constants with ones from FidoConstants.h;
3329         2. Merging m_assertionResponses and m_existingCredentials by replacing HashSet with Vector in Authenticator::Observer::selectAssertionResponse;
3330         3. Using Base64 encoded strings as the keys of the HashSet in produceHashSet() instead of the old casting hack;
3331         4. Invaliding the LAContext in LocalConnection::~LocalConnection() such that any displaying LocalAuthentication dialogs can be dismissed after the object is destroyed;
3332         5. Sorting existing credentials according to LRU before returning to UI clients;
3333         6. Improving the LocalAuthentication dialog titles for iOS.
3334
3335         * UIProcess/WebAuthentication/Authenticator.h:
3336         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
3337         (WebKit::AuthenticatorManager::selectAssertionResponse):
3338         * UIProcess/WebAuthentication/AuthenticatorManager.h:
3339         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.h:
3340         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
3341         (WebKit::LocalAuthenticatorInternal::produceHashSet):
3342         (WebKit::LocalAuthenticatorInternal::toNSData):
3343         (WebKit::LocalAuthenticatorInternal::getExistingCredentials):
3344         (WebKit::LocalAuthenticator::makeCredential):
3345         (WebKit::LocalAuthenticator::continueMakeCredentialAfterUserVerification):
3346         (WebKit::LocalAuthenticator::getAssertion):
3347         (WebKit::LocalAuthenticator::continueGetAssertionAfterUserVerification):
3348         * UIProcess/WebAuthentication/Cocoa/LocalConnection.h:
3349         (WebKit::LocalConnection::filterResponses const):
3350         * UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
3351         (WebKit::WebCore::bundleName):
3352         (WebKit::LocalConnection::~LocalConnection):
3353         (WebKit::LocalConnection::verifyUser):
3354         (WebKit::LocalConnection::verifyUser const): Deleted.
3355         * UIProcess/WebAuthentication/Mock/MockLocalConnection.h:
3356         * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
3357         (WebKit::MockLocalConnection::verifyUser):
3358         (WebKit::MockLocalConnection::filterResponses const):
3359         (WebKit::MockLocalConnection::verifyUser const): Deleted.
3360         * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:
3361         (WebKit::CtapAuthenticator::continueGetAssertionAfterResponseReceived):
3362         (WebKit::CtapAuthenticator::continueGetNextAssertionAfterResponseReceived):
3363         * UIProcess/WebAuthentication/fido/CtapAuthenticator.h:
3364
3365 2020-04-30  Kate Cheney  <katherine_cheney@apple.com>
3366
3367         Change default of "inAppBrowserPrivacyQuirks" testing toggle to use it for tests only
3368         https://bugs.webkit.org/show_bug.cgi?id=211209
3369         <rdar://problem/62619659>
3370
3371         Reviewed by Brent Fulgham.
3372
3373         No new tests, behavior confirmed by existing tests.
3374
3375         * Shared/WebPreferences.yaml:
3376
3377 2020-04-30  Devin Rousso  <drousso@apple.com>
3378
3379         Unreviewed, add missing parenthesis
3380
3381         * UIProcess/WebPageProxy.cpp:
3382         (WebKit::WebPageProxy::handleMediaEvent):
3383
3384 2020-04-30  Chris Dumez  <cdumez@apple.com>
3385
3386         [iOS][WK2] Add timeout for "Client navigation" foreground assertion
3387         https://bugs.webkit.org/show_bug.cgi?id=211202
3388
3389         Reviewed by Alex Christensen.
3390
3391         Add a 30s timeout for "Client navigation" foreground assertion. Foreground assertions do not timeout
3392         at RunningBoard level and we thus need to make sure we release them to avoid power leaks.
3393
3394         * UIProcess/API/APINavigation.cpp:
3395         (API::Navigation::Navigation):
3396         * UIProcess/API/APINavigation.h:
3397         (API::Navigation::setClientNavigationActivity):
3398         (API::Navigation::setForegroundActivity): Deleted.
3399         * UIProcess/ProcessThrottler.cpp:
3400         (WebKit::ProcessThrottler::TimedActivity::TimedActivity):
3401         (WebKit::ProcessThrottler::TimedActivity::operator=):
3402         (WebKit::ProcessThrottler::TimedActivity::activityTimedOut):
3403         (WebKit::ProcessThrottler::TimedActivity::updateTimer):
3404         * UIProcess/ProcessThrottler.h:
3405         * UIProcess/WebPageProxy.cpp:
3406         (WebKit::WebPageProxy::loadRequest):
3407         (WebKit::WebPageProxy::loadFile):
3408         (WebKit::WebPageProxy::loadData):
3409         (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
3410         (WebKit::WebPageProxy::didFinishLoadForFrame):
3411         (WebKit::WebPageProxy::didFailLoadForFrame):
3412
3413 2020-04-30  Alex Christensen  <achristensen@webkit.org>
3414
3415         Add SPI to change a WKWebView's CORS disabling pattern after initialization
3416         https://bugs.webkit.org/show_bug.cgi?id=211211
3417         <rdar://problem/61837474>
3418
3419         Reviewed by Chris Dumez.
3420
3421         * UIProcess/API/Cocoa/WKWebView.mm:
3422         (-[WKWebView _corsDisablingPatterns]):
3423         (-[WKWebView _setCORSDisablingPatterns:]):
3424         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3425         * UIProcess/WebPageProxy.cpp:
3426         * UIProcess/WebPageProxy.h:
3427         (WebKit::WebPageProxy::corsDisablingPatterns const):
3428         * WebProcess/WebPage/WebPage.cpp:
3429         (WebKit::parseAndAllowAccessToCORSDisablingPatterns):
3430         (WebKit::m_isNavigatingToAppBoundDomain):
3431         (WebKit::WebPage::updateCORSDisablingPatterns):
3432         * WebProcess/WebPage/WebPage.h:
3433         * WebProcess/WebPage/WebPage.messages.in:
3434
3435 2020-04-30  Daniel Bates  <dabates@apple.com>
3436
3437         [iOS] Implement -markedTextRange
3438         https://bugs.webkit.org/show_bug.cgi?id=211148
3439         <rdar://problem/57865890>
3440
3441         Reviewed by Wenson Hsieh.
3442
3443         Return the UITextRange-like object for the marked text range. Clients can use this range to
3444         access the selection rects or query for the caret rect at the start or end of the range,
3445         if desired.
3446
3447         * Shared/EditorState.cpp:
3448         (WebKit::EditorState::PostLayoutData::encode const):
3449         (WebKit::EditorState::PostLayoutData::decode):
3450         Encode and decode the marked text selection rects and caret rects at the state and end
3451         of the marked text range. This is the same information that we compute in order to
3452         implement -selectedTextRange. I thought about collecting these details into class and
3453         having editor state hold two instances of it: one for selected text and one for marked text.
3454         However I decided against it because this class is unlikely to find use outside of what is
3455         needed to implement -selectedTextRange and -markedTextRange. This is because only those
3456         functions require such details so as to return an opaque UITextRange-derived object that
3457         can be passed to- or its sub-objects can be passed to WKContentView's -caretRectForPosition
3458         and -selectionRectsForRange. Literally, WKContentView does not support other UITextInput
3459         functions that operate on UITextRange or UITextPosition. I didn't pursue fixing this in
3460         general because 1) I don't need it to solve my problem and 2) UIWKDocumentContext SPI seems
3461         to be the new general-purpose solution.
3462
3463         (WebKit::operator<<): Pretty print all the new marked text details we collect. While I am here,
3464         use Vector::isEmpty() instead of Vector::size() to check if there are selection rects.
3465         * Shared/EditorState.h:
3466         * UIProcess/ios/WKContentViewInteraction.mm:
3467         (-[WKContentView textFirstRect]):
3468         (-[WKContentView textLastRect]):
3469         Update code now that the marked text rects are in the post layout data sub-object.
3470
3471         (-[WKContentView _scaledCaretRectForSelectionStart:]): Extracted from -selectedTextRange.
3472         (-[WKContentView _scaledCaretRectForSelectionEnd:]): Ditto.
3473         (-[WKContentView selectedTextRange]): Write in terms of -_scaledCaretRectForSelectionStart
3474         and -_scaledCaretRectForSelectionEnd. Also modernize the code while I am here.
3475         (-[WKContentView markedTextRange]): Added.
3476         * WebProcess/WebPage/ios/WebPageIOS.mm:
3477         (WebKit::WebPage::getPlatformEditorState const): Collect the marked text rects and the caret
3478         rects at the start and end of the range.
3479
3480 2020-04-30  Carlos Garcia Campos  <cgarcia@igalia.com>
3481
3482         [GTK4][X11] Add support for rendering web view contents
3483         https://bugs.webkit.org/show_bug.cgi?id=211189
3484
3485         Reviewed by Adrian Perez de Castro.
3486
3487         Use GdkDisplayX11::xevent signal instead of filtering events that is no longer available in GTK4. GdkVisual no
3488         longer exists either, so we get the X visual from the PlatformDisplay.
3489
3490         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
3491         (WebKit::XDamageNotifier::add):
3492         (WebKit::XDamageNotifier::remove):
3493         (WebKit::XDamageNotifier::filterXDamageEvent):
3494         (WebKit::AcceleratedBackingStoreX11::~AcceleratedBackingStoreX11):
3495         (WebKit::AcceleratedBackingStoreX11::update):
3496         (WebKit::AcceleratedBackingStoreX11::snapshot):
3497         * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.cpp:
3498         (WebKit::AcceleratedSurfaceX11::AcceleratedSurfaceX11):
3499         (WebKit::AcceleratedSurfaceX11::createPixmap):
3500
3501 2020-04-30  Carlos Garcia Campos  <cgarcia@igalia.com>
3502
3503         [GTK4] Add support click events
3504         https://bugs.webkit.org/show_bug.cgi?id=211175
3505
3506         Reviewed by Adrian Perez de Castro.
3507
3508         Handle button pressed and released events using a GtkGestureClick.
3509
3510         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3511         (ClickCounter::currentClickCountForGdkButtonEvent):
3512         (webkitWebViewBaseButtonPressed):
3513         (webkitWebViewBaseButtonReleased):
3514         (webkitWebViewBaseConstructed):
3515         (webkitWebViewBaseResetClickCounter):
3516
3517 2020-04-29  Simon Fraser  <simon.fraser@apple.com>
3518
3519         Use initializers in PlatformMouseEvent and WebEvent
3520         https://bugs.webkit.org/show_bug.cgi?id=211217
3521
3522         Reviewed by Tim Horton.
3523
3524         Use initializers im WebEvent.
3525
3526         * Shared/WebEvent.h:
3527         * Shared/WebMouseEvent.cpp:
3528
3529 2020-04-29  Brent Fulgham  <bfulgham@apple.com>
3530
3531         Improve SandboxExtension::HandleArray to reduce boilerplate
3532         https://bugs.webkit.org/show_bug.cgi?id=211103
3533         <rdar://problem/62533632>
3534
3535         Reviewed by Per Arne Vollan.
3536
3537         There are a number of boilerplate patterns needed when using SandboxExtension::HandleArray.
3538         We could make these simpler and less error prone by improving the class.
3539
3540         This patch:
3541         1. Adds convenience methods to create and consume HandleArrays.
3542         2. Updates uses of HandleArray to use the convenience methods.
3543
3544         Tested by existing tests.
3545
3546         * Platform/IPC/FormDataReference.h:
3547         (IPC::FormDataReference::decode):
3548         * Shared/Cocoa/SandboxExtensionCocoa.mm:
3549         (WebKit::SandboxExtension::createHandlesForFiles):
3550         (WebKit::SandboxExtension::createHandlesForMachLookup):
3551         (WebKit::SandboxExtension::consumePermanently):
3552         * Shared/SandboxExtension.h:
3553         (WebKit::createHandlesForFiles):
3554         (WebKit::SandboxExtension::consumePermanently):
3555         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3556         (WebKit::WebProcessPool::platformInitializeWebProcess):
3557         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
3558         (WebKit::WebProcessProxy::unblockPreferenceServiceIfNeeded):
3559         * UIProcess/WebPageProxy.cpp:
3560         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3561         (WebKit::WebPlatformStrategies::getPathnamesForType):
3562         * WebProcess/WebPage/WebPage.cpp:
3563         (WebKit::WebPage::extendSandboxForFilesFromOpenPanel):
3564         * WebProcess/WebProcess.cpp:
3565         (WebKit::WebProcess::initializeWebProcess):
3566         * WebProcess/cocoa/WebProcessCocoa.mm:
3567         (WebKit::WebProcess::platformInitializeWebProcess):
3568         (WebKit::WebProcess::unblockPreferenceService):
3569
3570 2020-04-29  Chris Dumez  <cdumez@apple.com>
3571
3572         REGRESSION(r260791) Network process fails to suspend promptly
3573         https://bugs.webkit.org/show_bug.cgi?id=211207
3574         <rdar://problem/62620454>
3575
3576         Reviewed by Alex Christensen.
3577
3578         After r260791, all WebResourceLoadStatisticsStore instances share a single WorkQueue.
3579         As a result, the logic to suspend WebResourceLoadStatisticsStore's WorkQueues in
3580         NetworkProcess::prepareToSuspend() needs to get updated to reflect this.
3581
3582         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
3583         (WebKit::WebResourceLoadStatisticsStore::suspend):
3584         (WebKit::WebResourceLoadStatisticsStore::resume):
3585         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
3586         * NetworkProcess/NetworkProcess.cpp:
3587         (WebKit::NetworkProcess::prepareToSuspend):
3588         (WebKit::NetworkProcess::resume):
3589
3590 2020-04-29  Adrian Perez de Castro  <aperez@igalia.com>
3591
3592         REGRESSION(r260889): TestContextMenu:/webkit/WebKitWebView/populate-menu no longer passes
3593         https://bugs.webkit.org/show_bug.cgi?id=211203
3594
3595         Reviewed by Aakash Jain.
3596
3597         No new tests needed.
3598
3599         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
3600         (WebKit::WebContextMenuProxyGtk::WebContextMenuProxyGtk): Attach the correct action
3601         group to the popover widget, instead of a temporary which will always be empty.
3602
3603 2020-04-29  David Kilzer  <ddkilzer@apple.com>
3604
3605         REGRESSION (r246395): Leak of ARQuickLookPreviewItem and ARQuickLookWebKitItem in -[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]
3606         <https://webkit.org/b/211197>
3607         <rdar://problem/62612483>
3608
3609         Reviewed by Darin Adler.
3610
3611         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
3612         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
3613         - Use RetainPtr<> and adoptNS() to fix leaks.
3614
3615 2020-04-29  Per Arne Vollan  <pvollan@apple.com>
3616
3617         Unreviewed sandbox compile fix.
3618
3619         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3620
3621 2020-04-29  Alex Christensen  <achristensen@webkit.org>
3622
3623         Add WKNavigationDelegate API shouldAllowDeprecatedTLS
3624         https://bugs.webkit.org/show_bug.cgi?id=210981
3625         <rdar://problem/61742976>
3626
3627         Reviewed by Geoffrey Garen.
3628
3629         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
3630         * UIProcess/Cocoa/NavigationState.h:
3631         * UIProcess/Cocoa/NavigationState.mm:
3632         (WebKit::NavigationState::setNavigationDelegate):
3633         (WebKit::NavigationState::NavigationClient::shouldAllowLegacyTLS):
3634
3635 2020-04-29  Chris Dumez  <cdumez@apple.com>
3636
3637         [iOS][WK2] Temporarily stop using RunningBoard for the foreground process assertion
3638         https://bugs.webkit.org/show_bug.cgi?id=211196
3639         <rdar://problem/62535822>
3640
3641         Reviewed by Tim Horton.
3642
3643         Temporarily stop using RunningBoard for the foreground process assertion. On recent iOS builds, there
3644         are issues where this assertion can time out after 30 seconds, even though the process is still
3645         foreground.
3646
3647         * Configurations/WebKit.xcconfig:
3648         * UIProcess/ProcessAssertion.h:
3649         * UIProcess/ios/ProcessAssertionIOS.mm:
3650         (WebKit::runningBoardNameForAssertionType):
3651         (WebKit::ProcessAssertion::ProcessAssertion):
3652         (WebKit::ProcessAssertion::~ProcessAssertion):
3653
3654 2020-04-29  Youenn Fablet  <youenn@apple.com>
3655
3656         Set _STAttributionDisplayName to iOS WebContent Info plist
3657         https://bugs.webkit.org/show_bug.cgi?id=210772
3658         <rdar://problem/62075201>
3659
3660         Reviewed by Eric Carlson.
3661
3662         Set _STAttributionDisplayName to 'Website' value.
3663
3664         * WebProcess/EntryPoint/Cocoa/XPCService/WebContentService/Info-iOS.plist:
3665
3666 2020-04-29  Kate Cheney  <katherine_cheney@apple.com>
3667
3668         Refactor layout tests after updates to In-App Browser Privacy
3669         https://bugs.webkit.org/show_bug.cgi?id=211146
3670         <rdar://problem/62524127>
3671
3672         Reviewed by Brent Fulgham.
3673
3674         Tests: http/tests/in-app-browser-privacy/app-bound-domain-gets-app-bound-session.html
3675                http/tests/in-app-browser-privacy/non-app-bound-domain-does-not-get-app-bound-session.html
3676
3677         Removes setInAppBrowserPrivacyEnabled, which is no longer needed by
3678         layout tests. Setting this in TestOptions is enough.
3679         getWebViewCategory is not needed because this patch deletes the only test
3680         which uses it. Lastly, adds a new function to clear app-bound sessions
3681         now that multiple tests are checking for them.
3682
3683         * NetworkProcess/NetworkProcess.cpp:
3684         (WebKit::NetworkProcess::clearAppBoundSession):
3685         (WebKit::NetworkProcess::setInAppBrowserPrivacyEnabled): Deleted.
3686         * NetworkProcess/NetworkProcess.h:
3687         * NetworkProcess/NetworkProcess.messages.in:
3688         * NetworkProcess/NetworkSession.h:
3689         (WebKit::NetworkSession::clearAppBoundSession):
3690         (WebKit::NetworkSession::setInAppBrowserPrivacyEnabled): Deleted.
3691         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
3692         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3693         (WebKit::NetworkSessionCocoa::appBoundSession):
3694         (WebKit::NetworkSessionCocoa::clearAppBoundSession):
3695         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
3696         (WKWebsiteDataStoreClearAppBoundSession):
3697         (WKWebsiteDataStoreSetInAppBrowserPrivacyEnabled): Deleted.
3698         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
3699         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3700         (-[WKWebsiteDataStore _getWebViewCategoryFor:completionHandler:]): Deleted.
3701         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
3702         * UIProcess/Network/NetworkProcessProxy.cpp:
3703         (WebKit::NetworkProcessProxy::clearAppBoundSession):
3704         (WebKit::NetworkProcessProxy::setInAppBrowserPrivacyEnabled): Deleted.
3705         * UIProcess/Network/NetworkProcessProxy.h:
3706         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3707         (WebKit::WebsiteDataStore::clearAppBoundSession):
3708         (WebKit::WebsiteDataStore::setInAppBrowserPrivacyEnabled): Deleted.
3709         * UIProcess/WebsiteData/WebsiteDataStore.h:
3710
3711 2020-04-29  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
3712
3713         [GPUP][GTK] compile GPUProcess in GTK port
3714         https://bugs.webkit.org/show_bug.cgi?id=208814
3715
3716         Reviewed by Don Olmstead.
3717
3718         Enable GPUProcess compilation in WebKitGTK as an experimental
3719         feature
3720
3721         No new tests required.
3722
3723         * GPUProcess/GPUConnectionToWebProcess.cpp: guard
3724         UserMediaCaptureManagerProxy for Cocoa platform only.
3725         (WebKit::GPUConnectionToWebProcess::dispatchMessage): guard
3726         messages from UserMediaCaptureManagerProxy for Cocoa platform,
3727         moving up this guard from video track messages.
3728         (WebKit::GPUConnectionToWebProcess::mediaKeyStorageDirectory):
3729         removed guard for this function of ENCRYPTED_MEDIA leaving only
3730         LEGACY_ENCRYPTED_MEDIA, since it's were it is defined.
3731         (WebKit::GPUConnectionToWebProcess::setOrientationForMediaCapture):
3732         guard the content of this function for Cocoa platform, since it is
3733         calling a UserMediaCaptureManagerProxy object.
3734         * GPUProcess/GPUProcess.cpp: Replace the included header to match
3735         with the used symbols in file.
3736         * GPUProcess/gstreamer/GPUProcessGStreamer.cpp: Added.
3737         (WebKit::GPUProcess::initializeProcess): Empty function.
3738         (WebKit::GPUProcess::initializeProcessName): Empty function.
3739         (WebKit::GPUProcess::initializeSandbox): Empty function.
3740         * GPUProcess/gstreamer/GPUProcessMainGStreamer.cpp: Added.
3741         (WebKit::initializeAuxiliaryProcess<GPUProcess>): New function.
3742         (WebKit::GPUProcessMain): New function.
3743         * GPUProcess/media/RemoteLegacyCDMFactoryProxy.cpp: changed guard
3744         for this file from ENCRYPTED_MEDIA to LEGACY_ENCRYPTED_MEDIA to
3745         match with its header file.
3746         * GPUProcess/media/gstreamer/RemoteMediaPlayerProxyGStreamer.cpp: Added.
3747         (WebKit::RemoteMediaPlayerProxy::prepareForPlayback):
3748         New function that raises noImplemented()
3749         (WebKit::RemoteMediaPlayerProxy::mediaPlayerFirstVideoFrameAvailable):
3750         New function that raises noImplemented()
3751         (WebKit::RemoteMediaPlayerProxy::mediaPlayerRenderingModeChanged):
3752         New function that raises noImplemented()
3753         (WebKit::RemoteMediaPlayerProxy::enterFullscreen): New function
3754         that raises noImplemented()
3755         (WebKit::RemoteMediaPlayerProxy::exitFullscreen): New function
3756         that raises noImplemented()
3757         * PlatformGTK.cmake: add Platform/generic header directory.
3758         * SourcesGTK.txt: Add the new files and
3759         GPUProcess/media/RemoteAudioDestinationManager.cpp
3760         * WebProcess/GPU/GPUProcessConnection.cpp: guard
3761         UserMediaCaptureManager for Cocoa platform only.
3762         (WebKit::GPUProcessConnection::dispatchMessage): guard messages
3763         from UserMediaCaptureManager for Cocoa platform, moving up this
3764         guard applied also for video track.
3765         * WebProcess/GPU/media/RemoteCDM.cpp: include missing header
3766         GPUProcessConnection.h
3767         * WebProcess/GPU/media/gstreamer/VideoLayerRemoteGStreamer.cpp: Added.
3768         (WebKit::createVideoLayerRemote): New function
3769         that raises noImplemented()
3770
3771 2020-04-29  Claudio Saavedra  <csaavedra@igalia.com>
3772
3773         [GTK4] Unreviewed compile-warning fixes
3774
3775         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3776         (webkitWebViewBaseSetEnableBackForwardNavigationGesture):
3777         (webkitWebViewBaseWillSwapWebProcess):
3778
3779 2020-04-29  Rob Buis  <rbuis@igalia.com>
3780
3781         Make PolicyChecker an inner class of FrameLoader
3782         https://bugs.webkit.org/show_bug.cgi?id=211138
3783
3784         Reviewed by Alex Christensen.
3785
3786         Adapt to PolicyChecker::ShouldContinue change.
3787
3788         * GPUProcess/media/RemoteMediaResource.cpp:
3789         (WebKit::RemoteMediaResource::responseReceived):
3790         * GPUProcess/media/RemoteMediaResource.h:
3791         * GPUProcess/media/RemoteMediaResourceManager.cpp:
3792         (WebKit::RemoteMediaResourceManager::responseReceived):
3793         * GPUProcess/media/RemoteMediaResourceManager.h:
3794         * GPUProcess/media/RemoteMediaResourceManager.messages.in:
3795         * Scripts/webkit/messages.py:
3796         * WebProcess/GPU/media/RemoteMediaResourceProxy.cpp:
3797         (WebKit::RemoteMediaResourceProxy::responseReceived):
3798         * WebProcess/GPU/media/RemoteMediaResourceProxy.h:
3799
3800 2020-04-29  Adrian Perez de Castro  <aperez@igalia.com>
3801
3802         [GTK] Misplaced right click menu on web page due to deprecated gtk_menu_popup()
3803         https://bugs.webkit.org/show_bug.cgi?id=170553
3804
3805         Reviewed by Carlos Garcia Campos.
3806
3807         Replace GtkMenuShell with a GtkPopoverMenu for context menus. The former is not available
3808         at all in GTK4, and the later allows for simplifying the positioning code: it is enough
3809         to provide a point in WebKitWebView widget where to place the popup, and GTK takes care
3810         of everything. This removes the custom positioning code (as it is not needed anymore),
3811         which did GdkScreen-relative calculations that GTK4 does not support.
3812
3813         No new tests needed.
3814
3815         * Shared/glib/WebContextMenuItemGlib.h:
3816         * UIProcess/API/glib/WebKitWebView.cpp:
3817         (contextMenuDismissed): Change parameter from GtkMenuShell to GtkMenuShell to GtkWidget.
3818         (webkitWebViewPopulateContextMenu): Connect to the GtkPopover::closed signal instead of
3819         GtkMenuShell::deactivate.
3820         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3821         (activeContextMenuClosed): Renamed from activeContextMenuUnmapped(), changed parameter
3822         from GtkMenuShell to GtkWidget, and compare with WebContextMenuProxyGtk::gtkWidget().
3823         (activeContextMenuUnmapped): Renamed to activeContextMenuClosed().
3824         (webkitWebViewBaseSetActiveContextMenuProxy): Connect to the GtkPopover::closed signal
3825         instead of GtkMenuShell::deactivate.
3826         (webkitWebViewBaseGetActiveContextMenuProxy):
3827         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
3828         * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
3829         * UIProcess/gtk/WebContextMenuProxyGtk.cpp: Arrange to use GtkPopoverMenu instead of
3830         GtkMenuShell.
3831         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
3832         (WebKit::WebContextMenuProxyGtk::populate):
3833         (WebKit::WebContextMenuProxyGtk::showContextMenuWithItems): Simplify using
3834         m_context.menuLocation() to obtain the location where to make the context menu popup
3835         next to, which allows removing the ::menuPositionFunction() callback as well.
3836         (WebKit::WebContextMenuProxyGtk::WebContextMenuProxyGtk):
3837         (WebKit::WebContextMenuProxyGtk::~WebContextMenuProxyGtk):
3838         * UIProcess/gtk/WebContextMenuProxyGtk.h: Remove declarations for ::menuPositionFunction()
3839         and ::m_popupPosition, which are now unneeded.
3840         (WebKit::WebContextMenuProxyGtk::gtkWidget const): Renamed from ::gtkMenu(), and made it
3841         return a GtkWidget.
3842
3843 2020-04-29  Commit Queue  <commit-queue@webkit.org>
3844
3845         Unreviewed, reverting r260650.
3846         https://bugs.webkit.org/show_bug.cgi?id=211172
3847
3848         It is breaking internal bots (Requested by youenn on #webkit).
3849
3850         Reverted changeset:
3851
3852         "Call STDynamicActivityAttributionPublisher in the WebProcess"
3853         https://bugs.webkit.org/show_bug.cgi?id=210772
3854         https://trac.webkit.org/changeset/260650
3855
3856 2020-04-29  Devin Rousso  <drousso@apple.com>
3857
3858         Web Inspector: Uncaught Exception: SyntaxError: Unexpected identifier 'E'. Expected either a closing ']' or a ',' following an array element.
3859         https://bugs.webkit.org/show_bug.cgi?id=211163
3860
3861         Reviewed by Joseph Pecoraro.
3862
3863         * WebProcess/Inspector/WebInspectorUI.cpp:
3864         (WebKit::WebInspectorUI::updateFindString):
3865         * WebProcess/Inspector/RemoteWebInspectorUI.cpp:
3866         (WebKit::RemoteWebInspectorUI::updateFindString):
3867         Use the newly exposed `JSON::Value::escapeString` to ensure that the `findString` will not
3868         throw a JavaScript exception when placed in the `InspectorFrontendAPI` call.
3869
3870 2020-04-28  Carlos Garcia Campos  <cgarcia@igalia.com>
3871
3872         [GTK4] Add support for key events
3873         https://bugs.webkit.org/show_bug.cgi?id=211128
3874
3875         Reviewed by Adrian Perez de Castro.
3876
3877         Handle key-pressed and key-released events using a GtkEventControllerKey. To receive key events the widget needs
3878         to be focused, so also implement GtkWidgetClass::grab_focus and handle enter and leave focus events. GTK4 needs
3879         the widget used by the key bindings translator to be added to a parent to be able to forward key events, so it's
3880         now added as a child internal widget of the WebKitWeViewBase.
3881
3882         * Shared/gtk/WebEventFactory.cpp:
3883         (WebKit::WebEventFactory::createWebKeyboardEvent):
3884         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3885         (webkitWebViewChildIsInternalWidget):
3886         (webkitWebViewBaseContainerRemove):
3887         (webkitWebViewBaseContainerForall):
3888         (webkitWebViewBaseFocusEnter):
3889         (webkitWebViewBaseFocusLeave):
3890         (webkitWebViewBaseKeyPressed):
3891         (webkitWebViewBaseKeyReleased):
3892         (webkitWebViewBaseGrabFocus):
3893         (webkitWebViewBaseConstructed):
3894         (webkit_web_view_base_class_init):
3895         * UIProcess/gtk/KeyBindingTranslator.cpp:
3896         (WebKit::KeyBindingTranslator::KeyBindingTranslator):
3897         (WebKit::KeyBindingTranslator::~KeyBindingTranslator):
3898         (WebKit::handleCustomKeyBindings):
3899         (WebKit::KeyBindingTranslator::commandsForKeyEvent):
3900         * UIProcess/gtk/KeyBindingTranslator.h:
3901         (WebKit::KeyBindingTranslator::widget const):
3902         (WebKit::KeyBindingTranslator::destroyed):
3903
3904 2020-04-28  Wenson Hsieh  <wenson_hsieh@apple.com>
3905
3906         [Text manipulation] Add a userInfo dictionary to _WKTextManipulationToken
3907         https://bugs.webkit.org/show_bug.cgi?id=211151
3908         <rdar://problem/62329534>
3909
3910         Reviewed by Darin Adler.
3911
3912         * UIProcess/API/Cocoa/WKWebView.mm:
3913         (createUserInfo):
3914         (-[WKWebView _startTextManipulationsWithConfiguration:completion:]):
3915         (-[WKWebView _completeTextManipulation:completion:]):
3916         (-[WKWebView _completeTextManipulationForItems:completion:]):
3917         * UIProcess/API/Cocoa/_WKTextManipulationToken.h:
3918         * UIProcess/API/Cocoa/_WKTextManipulationToken.mm:
3919         (-[_WKTextManipulationToken setUserInfo:]):
3920         (-[_WKTextManipulationToken userInfo]):
3921
3922         Add a new `userInfo` dictionary to `_WKTextManipulationToken`, which contains several named
3923         `NSString` keys.
3924
3925         (-[_WKTextManipulationToken isEqualToTextManipulationToken:includingContentEquality:]):
3926         (-[_WKTextManipulationToken _descriptionPreservingPrivacy:]):
3927
3928 2020-04-28  David Kilzer  <ddkilzer@apple.com>
3929
3930         REGRESSION (r260407): Over-release of NSGraphicsContext in WebKit::convertPlatformImageToBitmap()
3931         <https://webkit.org/b/211160>
3932
3933         Reviewed by Darin Adler.
3934
3935         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
3936         (WebKit::convertPlatformImageToBitmap): Use retainPtr() instead
3937         of adoptNS() to fix the over-release.
3938
3939 2020-04-28  David Kilzer  <ddkilzer@apple.com>
3940
3941         IPC::Decoder::isValid() should just be a nullptr check
3942         <https://webkit.org/b/211152>
3943         <rdar://problem/62552699>
3944
3945         Reviewed by Darin Adler.
3946
3947         * Platform/IPC/Decoder.h:
3948         (IPC::Decoder::isValid const): Change to nullptr check.  I
3949         reviewed the code in Decoder.{cpp,h}, and I didn't see
3950         m_bufferPos being set without a bounds check.  Also added
3951         WARN_UNUSED_RETURN to make sure the result is always checked.
3952
3953 2020-04-28  Daniel Bates  <dabates@apple.com>
3954
3955         Move WebPage::textInputContextsInRect() to WebPageIOS.mm
3956         https://bugs.webkit.org/show_bug.cgi?id=211136
3957
3958         Reviewed by Eric Carlson.
3959
3960         The function WebPage::textInputContextsInRect is very specific to a client on iOS.
3961         Although it's tempting to keep this cross-platform because its implementation does
3962         not make use of iOS-specific technologies it does a very specific operation, the
3963         result of which is a list of contexts to editable elements on the page. The contexts
3964         provide enough info for the specific iOS client, but not enough to ever be useful
3965         to any other client. Therefore move it to WebPageIOS.mm.
3966
3967         Only Mac and iOS were ever using this function. The former only for testing purposes
3968         that have since been removed.
3969
3970         A side effect of this change is that I also move WebPageProxy::textInputContextsInRect()
3971         from WebPageProxy.cpp to WebPageProxyIOS.mm.
3972
3973         * UIProcess/WebPageProxy.cpp:
3974         (WebKit::WebPageProxy::textInputContextsInRect): Deleted; moved to WebPageProxyIOS.mm.
3975         * UIProcess/WebPageProxy.h:
3976         * UIProcess/ios/WebPageProxyIOS.mm:
3977         (WebKit::WebPageProxy::textInputContextsInRect): Moved from WebPageProxy.cpp.
3978         * WebProcess/WebPage/WebPage.cpp:
3979         (WebKit::WebPage::textInputContextsInRect): Deleted; moved to WebPageIOS.mm.
3980         * WebProcess/WebPage/WebPage.h:
3981         * WebProcess/WebPage/WebPage.messages.in:
3982         * WebProcess/WebPage/ios/WebPageIOS.mm:
3983         (WebKit::WebPage::textInputContextsInRect): Moved from WebPage.cpp.
3984
3985 2020-04-28  Chris Dumez  <cdumez@apple.com>
3986
3987         [iOS][WK2] Drop process assertion logic for holding locked files
3988         https://bugs.webkit.org/show_bug.cgi?id=206910
3989
3990         Reviewed by Alex Christensen.
3991
3992         Drop process assertion logic for holding locked files as it is causing issues and
3993         should no longer be needed.
3994
3995         The intention of this code was that the Network Process would send a
3996         SetIsHoldingLockedFiles(bool) IPC to the UIProcess whenever there are pending
3997         SQLite transactions and the UIProcess&nb