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