75588a7c948ea1d37d5a2271c70fb959c139bdf9
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2020-05-20  Kate Cheney  <katherine_cheney@apple.com>
2
3         Support operating dates in ResourceLoadStatisticsDatabaseStore
4         https://bugs.webkit.org/show_bug.cgi?id=212034
5         <rdar://problem/63349242>
6
7         Reviewed by Brent Fulgham.
8
9         Tests: http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-database.html
10                http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed.html
11                http/tests/resourceLoadStatistics/operating-dates-all-website-data-removed-database.html
12                http/tests/resourceLoadStatistics/operating-dates-all-website-data-removed.html
13
14         Patch to support Operating Dates in the ResourceLoadStatisticsDatabaseStore.
15         Moves functions out of ResourceLoadStatisticsStore now that each store
16         needs its own implementation.
17
18         Adds a new function for testing which inserts an expired statistic
19         and makes sure the proper behavior occurs depending on additional
20         parameters.
21
22         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
23         (WebKit::createTableQueries):
24         (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
25         (WebKit::ResourceLoadStatisticsDatabaseStore::checkForMissingTablesInSchema):
26         (WebKit::ResourceLoadStatisticsDatabaseStore::createUniqueIndices):
27         (WebKit::ResourceLoadStatisticsDatabaseStore::createSchema):
28         (WebKit::ResourceLoadStatisticsDatabaseStore::getLeastRecentOperatingDate):
29         (WebKit::ResourceLoadStatisticsDatabaseStore::mergeOperatingDates):
30         (WebKit::ResourceLoadStatisticsDatabaseStore::includeTodayAsOperatingDateIfNecessary):
31         (WebKit::ResourceLoadStatisticsDatabaseStore::hasStatisticsExpired const):
32         (WebKit::ResourceLoadStatisticsDatabaseStore::insertExpiredStatisticForTesting):
33         Migrated Operating Dates functions from ResourceLoadStatisticsStore and implemented
34         them using SQLite instead of a vector. Functionality is
35         identical to the original in-memory implementation.
36
37         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
38         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
39         (WebKit::ResourceLoadStatisticsMemoryStore::ResourceLoadStatisticsMemoryStore):
40         (WebKit::ResourceLoadStatisticsMemoryStore::mergeOperatingDates):
41         (WebKit::ResourceLoadStatisticsMemoryStore::includeTodayAsOperatingDateIfNecessary):
42         (WebKit::ResourceLoadStatisticsMemoryStore::hasStatisticsExpired const):
43         (WebKit::ResourceLoadStatisticsMemoryStore::insertExpiredStatisticForTesting):
44         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
45         Migrated Operating Dates functions from ResourceLoadStatisticsStore
46         now that the database store does not use them.
47
48         * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp:
49         (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk):
50         Spelling error.
51
52         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
53         (WebKit::ResourceLoadStatisticsStore::ResourceLoadStatisticsStore):
54         (WebKit::ResourceLoadStatisticsStore::updateCookieBlockingForDomains):
55         (WebKit::ResourceLoadStatisticsStore::statisticsEpirationTime const): Deleted.
56         (WebKit::ResourceLoadStatisticsStore::mergeOperatingDates): Deleted.
57         (WebKit::ResourceLoadStatisticsStore::includeTodayAsOperatingDateIfNecessary): Deleted.
58         (WebKit::ResourceLoadStatisticsStore::hasStatisticsExpired const): Deleted.
59         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
60         (WebKit::OperatingDate::year const):
61         (WebKit::OperatingDate::month const):
62         (WebKit::OperatingDate::monthDay const):
63         These functions should be public now that they are needed outside
64         of this file after migrating OperatingDates functions.
65
66         (WebKit::ResourceLoadStatisticsStore::parameters const):
67         (WebKit::ResourceLoadStatisticsStore::operatingDates const): Deleted.
68         (WebKit::ResourceLoadStatisticsStore::clearOperatingDates): Deleted.
69         Moved OperatingDates functions to the memory store. Moved
70         operatingDatesWindow constexpr variables to the header file so that
71         the database and memory stores can both use them.
72
73         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
74         (WebKit::WebResourceLoadStatisticsStore::insertExpiredStatisticForTesting):
75         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
76         * NetworkProcess/NetworkProcess.cpp:
77         (WebKit::NetworkProcess::insertExpiredStatisticForTesting):
78         * NetworkProcess/NetworkProcess.h:
79         * NetworkProcess/NetworkProcess.messages.in:
80         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
81         (WKWebsiteDataStoreSetStatisticsExpiredStatistic):
82         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
83         * UIProcess/Network/NetworkProcessProxy.cpp:
84         (WebKit::NetworkProcessProxy::insertExpiredStatisticForTesting):
85         * UIProcess/Network/NetworkProcessProxy.h:
86         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
87         (WebKit::WebsiteDataStore::mergeStatisticForTesting):
88         (WebKit::WebsiteDataStore::insertExpiredStatisticForTesting):
89         * UIProcess/WebsiteData/WebsiteDataStore.h:
90         Function to add expired statistic to the ITP store.
91
92 2020-05-20  Chris Dumez  <cdumez@apple.com>
93
94         Deprecate WKBundlePageSetPolicyClient() Injected bundle C API
95         https://bugs.webkit.org/show_bug.cgi?id=212166
96
97         Reviewed by Alex Christensen.
98
99         Deprecate WKBundlePageSetPolicyClient() Injected bundle C API. Approving navigations from
100         the injected bundle can lead to WebProcess terminations like in <rdar://problem/60340647>
101         because the WebProcess is not in a position to do sandbox checks when navigating to file
102         URLs.
103
104         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
105
106 2020-05-20  Simon Fraser  <simon.fraser@apple.com>
107
108         Plumb the display's nominal refresh rate down to ScrollingTree for use in scroll synchronization
109         https://bugs.webkit.org/show_bug.cgi?id=212159
110
111         Reviewed by Tim Horton.
112
113         Plumb an Optional<unsigned> down windowScreenDidChange, which contains the nominal
114         display refresh rate (as frames per second) if available. On macOS, we get this
115         from CVDisplayLinkGetNominalOutputVideoRefreshPeriod().
116
117         To read it, WebProcessPool::nominalFramesPerSecondForDisplay() makes a DisplayLink
118         that doesn't get any observers, but that DisplayLink will very likely get used
119         as soon as we schedule a rendering update.
120
121         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
122         (WebKit::WebProcessPool::nominalFramesPerSecondForDisplay):
123         * UIProcess/Cocoa/WebViewImpl.mm:
124         (WebKit::WebViewImpl::windowDidChangeScreen):
125         * UIProcess/WebPageProxy.cpp:
126         (WebKit::WebPageProxy::windowScreenDidChange):
127         * UIProcess/WebPageProxy.h:
128         * UIProcess/WebProcessPool.h:
129         * UIProcess/mac/DisplayLink.cpp:
130         (WebKit::DisplayLink::DisplayLink):
131         (WebKit::DisplayLink::nominalFramesPerSecond const):
132         * UIProcess/mac/DisplayLink.h:
133         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
134         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
135         * WebProcess/WebPage/WebPage.cpp:
136         (WebKit::WebPage::windowScreenDidChange):
137         * WebProcess/WebPage/WebPage.h:
138         * WebProcess/WebPage/WebPage.messages.in:
139
140 2020-05-20  Myles C. Maxfield  <mmaxfield@apple.com>
141
142         [iPadOS] -webkit-text-size-adjust:percentage doesn't work in native apps
143         https://bugs.webkit.org/show_bug.cgi?id=212122
144         <rdar://problem/54560875>
145
146         Reviewed by Wenson Hsieh.
147
148         * Shared/WebsitePoliciesData.cpp:
149         (WebKit::WebsitePoliciesData::encode const):
150         (WebKit::WebsitePoliciesData::decode):
151         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
152         * Shared/WebsitePoliciesData.h:
153         * UIProcess/API/APIWebsitePolicies.cpp:
154         (API::WebsitePolicies::copy const):
155         (API::WebsitePolicies::data):
156         * UIProcess/API/APIWebsitePolicies.h:
157         * UIProcess/ios/WebPageProxyIOS.mm:
158         (WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):
159
160 2020-05-20  Kate Cheney  <katherine_cheney@apple.com>
161
162         REGRESSION (r261892) [ Mac Debug ] 4 API tests failing related to ResourceLoadStatistics
163         https://bugs.webkit.org/show_bug.cgi?id=212153
164         <rdar://problem/63452541>
165
166         Reviewed by Sihui Liu.
167
168         Accidentally deleted necessary reset() call for a SQLite statement
169         when converting stored statements to SQLiteStatementAutoResetScope in
170         https://trac.webkit.org/changeset/261892/webkit.
171
172         This statement is used in a loop with multiple bind() calls so it must be reset.
173
174         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
175         (WebKit::ResourceLoadStatisticsDatabaseStore::checkForMissingTablesInSchema):
176
177 2020-05-20  Eric Carlson  <eric.carlson@apple.com>
178
179         Update some media logging
180         https://bugs.webkit.org/show_bug.cgi?id=212109
181         <rdar://problem/63424816>
182
183         Unreviewed, remove a change unintentionally included in r261899.
184
185         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
186         (-[WKFullScreenWindowController _interactivePinchDismissChanged:]):
187
188 2020-05-20  Andy Estes  <aestes@apple.com>
189
190         [Mac] UI processes spin when creating the "Share" context menu item
191         https://bugs.webkit.org/show_bug.cgi?id=212137
192         <rdar://problem/54498394>
193
194         Reviewed by Wenson Hsieh.
195
196         On Mac, WebKit has been using the +[NSMenuItem standardShareMenuItemForItems:] SPI to create
197         the "Share" context submenu and menu item. This call performs synchronous IPC and can result
198         in UI process spins.
199
200         Where available, switch to using the asynchronous
201         -[NSSharingServicePicker getMenuWithCompletion:] SPI instead. This method only creates the
202         submenu, not the menu item, so when using this new method we must create the "Share" menu
203         item ourselves.
204
205         * UIProcess/mac/WebContextMenuProxyMac.h:
206         * UIProcess/mac/WebContextMenuProxyMac.mm:
207         (WebKit::getStandardShareMenuItem):
208         (WebKit::WebContextMenuProxyMac::getShareMenuItem):
209         (WebKit::WebContextMenuProxyMac::getContextMenuFromItems):
210         (WebKit::WebContextMenuProxyMac::getContextMenuItem):
211         (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
212         (WebKit::WebContextMenuProxyMac::createShareMenuItem): Deleted.
213         (WebKit::WebContextMenuProxyMac::createContextMenuFromItems): Deleted.
214         (WebKit::WebContextMenuProxyMac::createContextMenuItem): Deleted.
215
216 2020-05-20  Carlos Garcia Campos  <cgarcia@igalia.com>
217
218         Unreviewed. Fix GTK4 build with GTK 3.98.4
219
220         * PlatformGTK.cmake:
221         * UIProcess/API/gtk/WebKitPrintOperation.cpp:
222         (webkitPrintOperationRunDialog):
223         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
224         (webkitWebViewBaseAddDialog):
225         (webkitWebViewBaseRemoveChild):
226         (webkitWebViewBaseContainerForall):
227         (webkitWebViewBaseAddWebInspector):
228         (webkitWebViewBaseRemoveWebInspector):
229         (webkitWebViewBaseDispose):
230         (webkitWebViewBaseSizeAllocate):
231         (webkitWebViewBaseConstructed):
232         (webkit_web_view_base_class_init):
233         * UIProcess/API/gtk/WebKitWebViewBase.h: Removed.
234         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
235         * UIProcess/Inspector/gtk/RemoteWebInspectorProxyGtk.cpp:
236         (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
237         (WebKit::RemoteWebInspectorProxy::platformSave):
238         * UIProcess/Inspector/gtk/WebInspectorProxyGtk.cpp:
239         (WebKit::WebInspectorProxy::platformCreateFrontendWindow):
240         (WebKit::WebInspectorProxy::platformAttach):
241         (WebKit::WebInspectorProxy::platformDetach):
242         (WebKit::WebInspectorProxy::platformSave):
243         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
244         (WebKit::WebContextMenuProxyGtk::~WebContextMenuProxyGtk):
245
246 2020-05-12  Carlos Garcia Campos  <cgarcia@igalia.com>
247
248         [GTK4] Add support for drag and drop operations
249         https://bugs.webkit.org/show_bug.cgi?id=211779
250
251         Reviewed by Adrian Perez de Castro.
252
253         * UIProcess/API/gtk/DragSource.h:
254         * UIProcess/API/gtk/DragSourceGtk4.cpp:
255         (WebKit::DragSource::begin):
256         * UIProcess/API/gtk/DropTarget.h:
257         * UIProcess/API/gtk/DropTargetGtk4.cpp:
258         (WebKit::DropTarget::DropTarget):
259         (WebKit::DropTarget::~DropTarget):
260         (WebKit::DropTarget::accept):
261         (WebKit::DropReadAsyncData::DropReadAsyncData):
262         (WebKit::DropTarget::loadData):
263         (WebKit::DropTarget::didLoadData):
264         (WebKit::DropTarget::enter):
265         (WebKit::DropTarget::update):
266         (WebKit::DropTarget::didPerformAction):
267         (WebKit::DropTarget::leave):
268         (WebKit::DropTarget::drop):
269
270 2020-05-19  Wenson Hsieh  <wenson_hsieh@apple.com>
271
272         REGRESSION (r258919): fast/events/ios/key-events-comprehensive/key-events-control tests are failing
273         https://bugs.webkit.org/show_bug.cgi?id=212124
274         <rdar://problem/60893744>
275
276         Reviewed by Tim Horton.
277
278         After the changes in r258919, WKContentView's text input traits report that we're in a single line input, even
279         when there is no editable focused element. This prevents UIKit from allowing WebKit to handle the `CTRL + M`
280         key command, which is interpreted at the system level as inserting a line break in a multi-line editable area.
281
282         It seems odd to consider ourselves in a single line input when there isn't even an editable element focused
283         element; for now, we can fix these failing tests by just going with the default value for the text input traits'
284         `setIsSingleLineDocument` property, but not explicitly setting it to either `NO` or `YES` when no element is
285         focused.
286
287         * UIProcess/ios/WKContentViewInteraction.mm:
288         (-[WKContentView textInputTraits]):
289
290 2020-05-19  Sam Weinig  <weinig@apple.com>
291
292         Remove almost always incorrect Color::getRGBA
293         https://bugs.webkit.org/show_bug.cgi?id=212059
294
295         Reviewed by Darin Adler and Simon Fraser.
296
297         * UIProcess/API/wpe/WebKitColor.cpp:
298         (webkitColorFillFromWebCoreColor):
299         * UIProcess/gtk/ViewGestureControllerGtk.cpp:
300         (WebKit::ViewGestureController::beginSwipeGesture):
301         * WebProcess/WebPage/WebFrame.cpp:
302         (WebKit::WebFrame::getDocumentBackgroundColor):
303         Replace Color::getRGBA with Color::toSRGBAComponentsLossy()
304
305 2020-05-19  Simon Fraser  <simon.fraser@apple.com>
306
307         Use an ObjectIdentifier<> for DisplayLink observer IDs
308         https://bugs.webkit.org/show_bug.cgi?id=212112
309
310         Reviewed by Per Arne Vollan.
311
312         Replace unsigned observerID with DisplayLinkObserverID, which is a typesafe ObjectIdentifier<>.
313
314         Use PlatformDisplayID in more places.
315
316         * Scripts/webkit/messages.py:
317         * Shared/DisplayLinkObserverID.h: Copied from Source/WebKit/UIProcess/mac/DisplayLink.h.
318         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
319         (WebKit::WebProcessPool::startDisplayLink):
320         (WebKit::WebProcessPool::stopDisplayLink):
321         * UIProcess/WebProcessPool.h:
322         * UIProcess/WebProcessProxy.h:
323         * UIProcess/WebProcessProxy.messages.in:
324         * UIProcess/mac/DisplayLink.cpp:
325         (WebKit::DisplayLink::addObserver):
326         (WebKit::DisplayLink::removeObserver):
327         * UIProcess/mac/DisplayLink.h:
328         * UIProcess/mac/WebProcessProxyMac.mm:
329         (WebKit::WebProcessProxy::startDisplayLink):
330         (WebKit::WebProcessProxy::stopDisplayLink):
331         * WebKit.xcodeproj/project.pbxproj:
332         * WebProcess/WebPage/mac/DrawingAreaMac.cpp:
333         (WebKit::DisplayRefreshMonitorMac::DisplayRefreshMonitorMac):
334
335 2020-05-19  Alex Christensen  <achristensen@webkit.org>
336
337         Add _WKDownloadDelegate callback including totalBytesWritten
338         https://bugs.webkit.org/show_bug.cgi?id=212110
339         <rdar://problem/63358981>
340
341         Reviewed by Geoffrey Garen.
342
343         Without this new callback, after resuming a download, a client has no way to tell whether the download was successfully
344         resumed by a server that has proper etag and range request support or whether the download began at the beginning again.
345         A client was guessing that the download did not restart, causing incorrect reported download sizes when the download did restart.
346         Luckily, the data on disk was not corrupted, just the UI.  This allows us to fix the UI.
347
348         Testing covered by expanding the API test for resuming downloads.
349
350         * NetworkProcess/Downloads/Download.cpp:
351         (WebKit::Download::didReceiveData):
352         * NetworkProcess/Downloads/Download.h:
353         * NetworkProcess/NetworkDataTaskBlob.cpp:
354         (WebKit::NetworkDataTaskBlob::writeDownload):
355         * NetworkProcess/NetworkDataTaskBlob.h:
356         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
357         (-[WKNetworkSessionDelegate URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]):
358         * UIProcess/API/APIDownloadClient.h:
359         (API::DownloadClient::didReceiveData):
360         * UIProcess/API/C/WKContext.cpp:
361         (WKContextSetDownloadClient):
362         * UIProcess/API/Cocoa/_WKDownloadDelegate.h:
363         * UIProcess/Cocoa/DownloadClient.h:
364         * UIProcess/Cocoa/DownloadClient.mm:
365         (WebKit::DownloadClient::DownloadClient):
366         (WebKit::DownloadClient::didReceiveResponse):
367         (WebKit::DownloadClient::didReceiveData):
368         * UIProcess/Downloads/DownloadProxy.cpp:
369         (WebKit::DownloadProxy::didReceiveData):
370         * UIProcess/Downloads/DownloadProxy.h:
371         (WebKit::DownloadProxy::expectedContentLength const): Deleted.
372         (WebKit::DownloadProxy::setExpectedContentLength): Deleted.
373         (WebKit::DownloadProxy::bytesLoaded const): Deleted.
374         (WebKit::DownloadProxy::setBytesLoaded): Deleted.
375         * UIProcess/Downloads/DownloadProxy.messages.in:
376
377 2020-05-19  Kate Cheney  <katherine_cheney@apple.com>
378
379         ITP database should finalize all prepared statements before closing
380         https://bugs.webkit.org/show_bug.cgi?id=211929
381         <rdar://problem/63246945>
382
383         Reviewed by John Wilander.
384
385         No new tests, behavior confirmed by existing tests.
386
387         Convert all SQLite statement objects to be unique pointers to better
388         manage the lifetime of each statement object. Only initialize and
389         prepare an object when it is needed instead of preparing all objects
390         at once. Set each statement to null before closing the database
391         because ~SQLiteStatement() will finalize the statement.
392
393         This patch removes all reset() commands now that we initialize
394         each statement using SQLiteStatementAutoResetScope.
395
396         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
397         (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
398         (WebKit::ResourceLoadStatisticsDatabaseStore::close):
399         (WebKit::ResourceLoadStatisticsDatabaseStore::getScopedStatement const):
400         Function to initialize and prepare a statement.
401
402         (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationship):
403         This function is not used and can be deleted.
404
405         (WebKit::ResourceLoadStatisticsDatabaseStore::checkForMissingTablesInSchema):
406         (WebKit::ResourceLoadStatisticsDatabaseStore::isMigrationNecessary):
407         (WebKit::ResourceLoadStatisticsDatabaseStore::openAndUpdateSchemaIfNecessary):
408         (WebKit::ResourceLoadStatisticsDatabaseStore::isEmpty const):
409         (WebKit::ResourceLoadStatisticsDatabaseStore::destroyStatements):
410         (WebKit::ResourceLoadStatisticsDatabaseStore::insertObservedDomain):
411         (WebKit::ResourceLoadStatisticsDatabaseStore::relationshipExists const):
412         (WebKit::ResourceLoadStatisticsDatabaseStore::domainID const):
413         (WebKit::ResourceLoadStatisticsDatabaseStore::merge):
414         (WebKit::ResourceLoadStatisticsDatabaseStore::mergeStatistic):
415         (WebKit::CompletionHandler<void):
416         (WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements): Deleted.
417         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
418         Updated all statement variables to end with "Statement" to follow the
419         established pattern.
420
421         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
422         (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
423
424 2020-05-19  Per Arne Vollan  <pvollan@apple.com>
425
426         [iOS] Fix message filter sandbox violation
427         https://bugs.webkit.org/show_bug.cgi?id=212100
428         <rdar://problem/63407155>
429
430         Reviewed by Andy Estes.
431
432         A message needs to be added to the message filter in the WebContent sandbox on iOS.
433
434         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
435
436 2020-05-19  Kate Cheney  <katherine_cheney@apple.com>
437
438         Revert WebKitTestRunner to reset ITP to the memory store between all tests.
439         https://bugs.webkit.org/show_bug.cgi?id=212094
440         <rdar://problem/63405806>
441
442         Reviewed by Chris Dumez.
443
444         Changing this in https://bugs.webkit.org/show_bug.cgi?id=211637 caused
445         test flakiness.
446
447         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
448         (WKWebsiteDataStoreStatisticsResetToConsistentState):
449
450 2020-05-19  Simon Fraser  <simon.fraser@apple.com>
451
452         Push a PlatformDisplayID to scrolling trees, and allow the scrolling thread to get displayDidRefresh notifications
453         https://bugs.webkit.org/show_bug.cgi?id=211034
454
455         Reviewed by Sam Weinig.
456
457         Prep work for webkit.org/b210884.
458
459         Have EventDispatcher call displayDidRefresh() on each scrolling tree it knows about. It calls this
460         on the EventDispatcher thread; the scrolling tree is responsible for bouncing that to the scrolling thread.
461
462         * WebProcess/WebPage/EventDispatcher.cpp:
463         (WebKit::EventDispatcher::displayDidRefreshOnScrollingThread):
464         (WebKit::EventDispatcher::displayWasRefreshed):
465         * WebProcess/WebPage/EventDispatcher.h:
466
467 2020-05-19  Wenson Hsieh  <wenson_hsieh@apple.com>
468
469         [macOS] Drag and drop within a contenteditable area duplicates attachment-backed images
470         https://bugs.webkit.org/show_bug.cgi?id=212075
471         <rdar://problem/62434146>
472
473         Reviewed by Andy Estes.
474
475         When the attachment API is enabled, starting a drag on an attachment-element-backed image within a
476         contenteditable area sometimes causes the ranged selection to collapse. This is because `WebViewImpl::startDrag`
477         has a separate codepath for starting a drag with attachment metadata that doesn't invoke `NSView`'s deprecated
478         `-dragImage:at:offset:event:pasteboar:source:slideBack:` method, but instead uses
479         `-beginDraggingSessionWithItems:event:source:`. While the former spins the runloop until the end of the drag
480         session, the latter does not and returns immediately after beginning the drag. As a result,
481         `WebPageProxy::didStartDrag()` is actually invoked after the drag ends when dragging non-attachment content,
482         whereas `WebPageProxy::didStartDrag()` is invoked immediately after beginning the drag when starting a drag in
483         an attachment or attachment-backed image element.
484
485         This call to `didStartDrag()` is used to inform the web process that dragging has begun, and sets the
486         `m_isStartingDrag` flag on `WebPage` to false. As a result, `m_isStartingDrag` is true over the course of the
487         drag session when dragging non-attachment elements, but it's only true while starting the drag when dragging
488         attachments. This flag is consulted in `WebPage::mouseEvent()` to determine whether we should avoid handling the
489         incoming mouse event when beginning a drag. This prevents these incoming mouse events from triggering selection
490         changes while dragging (for more details, refer to <http://trac.webkit.org/r176687>).
491
492         Now, if we combine this with the fact that mouse events can be queued up in the UI process (refer to
493         <https://trac.webkit.org/r230817>), it's possible to end up handling these queued mouse events in the web
494         process after `m_isStartingDrag` has been set back to false when dragging an attachment. This doesn't happen
495         when dragging non-attachment content, since we don't call `didStartDrag()` until the drag has already ended, so
496         any queued mouse events are sent to the web process and immediately dropped on the floor since
497         `m_isStartingDrag` is true.
498
499         To address this, we make a couple of minor adjustments:
500
501         1.  Invoke `didStartDrag()` right before calling into `-dragImage:at:offset:event:pasteboar:source:slideBack:`,
502             so that we don't wait until the drag ends to set `m_isStartingDrag` to false. This makes the behavior of
503             both codepaths for starting a drag (attachment and non-attachment) consistent, and also makes it consistent
504             with iOS.
505
506         2.  In `didStartDrag()`, discard any queued mouse events to prevent them from being handled by the page (e.g.
507             causing the selection to change immediately after starting the drag). We already have identical logic to do
508             this when showing a context menu, so we can factor this out into a private `WebPageProxy` helper and call it
509             from both places.
510
511         Test: WKAttachmentTestsMac.DraggingAttachmentBackedImagePreservesRangedSelection
512
513         * UIProcess/Cocoa/WebViewImpl.mm:
514         (WebKit::WebViewImpl::startDrag):
515
516         Invoke `didStartDrag()` earlier when starting a drag using the deprecated method, such that we don't wait until
517         the drag ends to set `m_isStartingDrag` to false in the web process.
518
519         * UIProcess/WebPageProxy.cpp:
520         (WebKit::WebPageProxy::discardQueuedMouseEvents):
521
522         Refactor logic to discard all queued mouse events into a separate private helper.
523
524         (WebKit::WebPageProxy::didStartDrag):
525
526         Use the above helper to empty queued mouse events when starting a drag.
527
528         (WebKit::WebPageProxy::showContextMenu):
529         * UIProcess/WebPageProxy.h:
530
531 2020-05-19  Andy Estes  <aestes@apple.com>
532
533         [Apple Pay] Add testing and logging for ApplePaySetup
534         https://bugs.webkit.org/show_bug.cgi?id=211972
535         <rdar://problem/63291965>
536
537         Reviewed by Alex Christensen.
538
539         * Shared/ApplePay/PaymentSetupConfiguration.mm:
540         (WebKit::toPlatformConfiguration):
541         (WebKit::PaymentSetupConfiguration::PaymentSetupConfiguration):
542         * Shared/ApplePay/PaymentSetupConfigurationWebKit.h:
543         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
544         (WebKit::WebPaymentCoordinator::getSetupFeatures):
545         (WebKit::WebPaymentCoordinator::beginApplePaySetup):
546         * WebProcess/ApplePay/WebPaymentCoordinator.h:
547
548 2020-05-19  Brent Fulgham  <bfulgham@apple.com>
549
550         REGRESSION(r243149): createMediaElementSource not working
551         https://bugs.webkit.org/show_bug.cgi?id=211394
552         <rdar://problem/62866132>
553
554         Reviewed by Per Arne Vollan.
555
556         I removed access to some Audio services in r243149, because we believed they were already
557         blocked by a global deny command. However, Sandbox rules override generic rules with
558         explicit rules, so the imported sandbox rules were not being blocked.
559
560         This patch re-adds the rules needed to support these audio routines on iOS hardware.
561
562         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
563         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
564         (WebKit::mediaRelatedMachServices):
565
566 2020-05-19  Chris Dumez  <cdumez@apple.com>
567
568         [iOS] Port Foreground process assertion to RunningBoard
569         https://bugs.webkit.org/show_bug.cgi?id=211795
570         <rdar://problem/61831863>
571
572         Reviewed by Geoffrey Garen.
573
574         Port Foreground process assertion to RunningBoard now that <rdar://problem/62614429>
575         has been fixed.
576
577         * Configurations/WebKit.xcconfig:
578         * UIProcess/ProcessAssertion.h:
579         * UIProcess/ios/ProcessAssertionIOS.mm:
580         (WebKit::runningBoardNameForAssertionType):
581         (WebKit::ProcessAssertion::ProcessAssertion):
582         (WebKit::ProcessAssertion::~ProcessAssertion):
583         (WebKit::ProcessAssertion::isValid const):
584
585 2020-05-19  Andy Estes  <aestes@apple.com>
586
587         [Apple Pay] Add testing and logging for ApplePaySetup
588         https://bugs.webkit.org/show_bug.cgi?id=211972
589         <rdar://problem/63291965>
590
591         Reviewed by Alex Christensen.
592
593         * Shared/ApplePay/PaymentSetupConfiguration.mm:
594         (WebKit::toPlatformConfiguration):
595         (WebKit::PaymentSetupConfiguration::PaymentSetupConfiguration):
596         * Shared/ApplePay/PaymentSetupConfigurationWebKit.h:
597         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
598         (WebKit::WebPaymentCoordinator::getSetupFeatures):
599         (WebKit::WebPaymentCoordinator::beginApplePaySetup):
600         * WebProcess/ApplePay/WebPaymentCoordinator.h:
601
602 2020-05-19  Michael Catanzaro  <mcatanzaro@gnome.org>
603
604         [GTK] Add WEBKIT_EDITING_COMMAND_PASTE_AS_PLAIN_TEXT
605         https://bugs.webkit.org/show_bug.cgi?id=212038
606
607         Reviewed by Carlos Garcia Campos.
608
609         * UIProcess/API/gtk/WebKitEditingCommands.h:
610         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
611         * UIProcess/API/wpe/WebKitEditingCommands.h:
612         * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:
613
614 2020-05-18  David Kilzer  <ddkilzer@apple.com>
615
616         Replace TextIndicatorOptions with OptionSet<TextIndicatorOption>
617         <https://webkit.org/b/212051>
618         <rdar://problem/63368556>
619
620         Reviewed by Simon Fraser.
621
622         Use OptionSet<TextIndicatorOption> everywhere
623         TextIndicatorOptions was previously used, plus:
624         - Make TextIndicatorOption an enum class.  Remove
625           "TextIndicatorOption" prefix so TextIndicatorOptionBar becomes
626           TextIndicatorOption::Bar.
627         - Remove TextIndicatorOptionDefault because OptionSet<>
628           initializes to zero.
629         - Replace static variables (including two globals in WebCore)
630           with constexpr variables.
631
632         * Shared/WebCoreArgumentCoders.cpp:
633         (IPC::ArgumentCoder<TextIndicatorData>::encode):
634         (IPC::ArgumentCoder<TextIndicatorData>::decode):
635         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
636         (WebKit::WebPage::dictionaryPopupInfoForRange):
637         * WebProcess/WebPage/FindController.cpp:
638         (WebKit::FindController::updateFindIndicator):
639         * WebProcess/WebPage/ios/FindControllerIOS.mm:
640         * WebProcess/WebPage/ios/WebPageIOS.mm:
641         (WebKit::WebPage::insertDroppedImagePlaceholders):
642         (WebKit::WebPage::computeAndSendEditDragSnapshot):
643         (WebKit::linkIndicatorPositionInformation):
644         * WebProcess/WebPage/mac/WebPageMac.mm:
645         (WebKit::WebPage::performImmediateActionHitTestAtLocation):
646
647 2020-05-18  Andy Estes  <aestes@apple.com>
648
649         http/tests/ssl/applepay/ApplePayInstallmentConfiguration.https.html fails in public SDK builds
650         https://bugs.webkit.org/show_bug.cgi?id=212000
651         <rdar://problem/63323082>
652
653         Reviewed by Youenn Fablet.
654
655         * Configurations/FeatureDefines.xcconfig:
656         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
657         * Shared/WebCoreArgumentCoders.h:
658
659 2020-05-18  Tim Horton  <timothy_horton@apple.com>
660
661         Rare crash under -[WKContentView resignFirstResponderForWebView]
662         https://bugs.webkit.org/show_bug.cgi?id=212050
663         <rdar://problem/60187111>
664
665         Reviewed by Wenson Hsieh.
666
667         * UIProcess/ios/WKContentViewInteraction.mm:
668         (-[WKContentView resignFirstResponderForWebView]):
669         Reorganize this block so that it always takes a strong reference /before/
670         null checking and using the pointer. Also, add a _page null check.
671         This is a speculative fix for an unreproducible low-rate crash.
672
673         In theory the existing time-of-check race here should not be a problem,
674         since WKWebView is supposed to be freed on the main thread, and this code
675         runs on the main thread, but we have ample evidence of WKWebView
676         being freed off the main thread in various clients.
677
678 2020-05-18  David Kilzer  <ddkilzer@apple.com>
679
680         Use default initializers in TextIndicatorData
681         <https://webkit.org/b/212039>
682         <rdar://problem/63355619>
683
684         Reviewed by Alex Christensen.
685
686         * Shared/WebCoreArgumentCoders.cpp:
687         (IPC::ArgumentCoder<TextIndicatorData>::encode):
688         (IPC::ArgumentCoder<TextIndicatorData>::decode):
689         - Switch from decodeEnum() and encodeEnum() to modern
690           equivalents that check for valid enum values.
691
692 2020-05-18  Wenson Hsieh  <wenson_hsieh@apple.com>
693
694         Replace uses of +self with +class
695         https://bugs.webkit.org/show_bug.cgi?id=212041
696
697         Reviewed by Darin Adler.
698
699         * Shared/API/Cocoa/_WKFrameHandle.mm:
700         (-[_WKFrameHandle isEqual:]):
701         (-[_WKFrameHandle initWithCoder:]):
702         * Shared/Cocoa/APIObject.mm:
703         (API::Object::newObject):
704         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
705         (-[WKWebViewConfiguration _setAttachmentFileWrapperClass:]):
706         * UIProcess/Cocoa/NavigationState.mm:
707         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
708         * UIProcess/Cocoa/PageClientImplCocoa.mm:
709         (WebKit::PageClientImplCocoa::allocFileWrapperInstance const):
710         (WebKit::PageClientImplCocoa::serializableFileWrapperClasses const):
711         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
712         (+[WKTransformView layerClass]):
713         (+[WKSimpleBackdropView layerClass]): Deleted.
714         (+[WKShapeView layerClass]): Deleted.
715         (-[WKRemoteView initWithFrame:contextID:]): Deleted.
716         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
717         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::~ScrollingTreeScrollingNodeDelegateIOS):
718         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::resetScrollViewDelegate):
719         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollView const):
720         * UIProcess/ios/WKContentViewInteraction.mm:
721         (-[WKContentView selectFormAccessoryPickerRow:]):
722         (-[WKContentView selectFormPopoverTitle]):
723
724 2020-05-18  Alex Christensen  <achristensen@webkit.org>
725
726         WebPageProxy::DidCommitLoadForFrame should use FrameLoadType instead of casting to/from uint32_t for IPC
727         https://bugs.webkit.org/show_bug.cgi?id=212028
728         <rdar://problem/63343021>
729
730         Reviewed by David Kilzer.
731
732         * UIProcess/ProvisionalPageProxy.cpp:
733         (WebKit::ProvisionalPageProxy::didCommitLoadForFrame):
734         * UIProcess/ProvisionalPageProxy.h:
735         * UIProcess/WebPageProxy.cpp:
736         (WebKit::WebPageProxy::commitProvisionalPage):
737         (WebKit::WebPageProxy::didCommitLoadForFrame):
738         * UIProcess/WebPageProxy.h:
739         * UIProcess/WebPageProxy.messages.in:
740         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
741         (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
742
743 2020-05-18  Wenson Hsieh  <wenson_hsieh@apple.com>
744
745         Single selection <select> with <optgroups> shows multiple selected options
746         https://bugs.webkit.org/show_bug.cgi?id=199485
747         <rdar://problem/52757531>
748
749         Reviewed by Megan Gardner.
750
751         Fixes a long-standing bug in WKMultipleSelectPicker. Prior to this patch, we rely on the delegate method
752         `-pickerView:row:column:checked:` to be called twice whenever an item is selected: one time for the item that is
753         no longer checked, and another for the newly checked item. This method is responsible for updating the cached
754         `FocusedElementInformation` that determines the data model for the select menu, with the expectation that the
755         unchecked item would be updated to have `isSelected = false;`, and the new checked item would have `isSelected`
756         `= true;`.
757
758         However, `-pickerView:row:column:checked:` is only called for visible item cells. This means that if the user
759         checks an item, scrolls the select menu items down so that the checked item is offscreen, and then checks a
760         different item, we only get notified that the new item is checked, and as a result, fail to uncheck the previous
761         item.
762
763         To address this, tweak our logic for handling a single select so that when an item is checked, we additionally
764         update the previously checked item to not be selected. Also, fix what seems to be a bug in the logic for
765         updating `_singleSelectionIndex`, which is currently updated even when the item is unchecked. It seems to work
766         out at the moment, because `-pickerView:row:column:checked:` seems to be called with `checked := YES` after the
767         previous item was unchecked (assuming that it was visible).
768
769         Test: fast/forms/ios/no-stale-checked-items-in-select-picker.html
770
771         * UIProcess/API/ios/WKWebViewPrivateForTestingIOS.h:
772         * UIProcess/API/ios/WKWebViewTestingIOS.mm:
773         (-[WKWebView selectFormAccessoryHasCheckedItemAtRow:]):
774         * UIProcess/ios/WKContentViewInteraction.h:
775         * UIProcess/ios/WKContentViewInteraction.mm:
776         (-[WKContentView selectFormAccessoryHasCheckedItemAtRow:]):
777
778         Add plumbing for a new testing hook.
779
780         * UIProcess/ios/forms/WKFormSelectControl.h:
781         * UIProcess/ios/forms/WKFormSelectControl.mm:
782         (-[WKFormSelectControl selectFormAccessoryHasCheckedItemAtRow:]):
783         * UIProcess/ios/forms/WKFormSelectPicker.mm:
784         (-[WKMultipleSelectPicker pickerView:viewForRow:forComponent:reusingView:]):
785         (-[WKMultipleSelectPicker pickerView:row:column:checked:]):
786         (-[WKMultipleSelectPicker selectRow:inComponent:extendingSelection:]):
787
788         Also, fix an existing bug in this testing helper method that crashed the test runner due to calling an
789         unimplemented selector. Instead of trying to invoke `-pickerView:didSelectRow:inComponent:`, we should be using
790         `-pickerView:row:column:checked:` instead for multiple select pickers (which, somewhat confusingly, are still
791         used for single select elements that have `optgroup`s.)
792
793         (-[WKMultipleSelectPicker selectFormAccessoryHasCheckedItemAtRow:]):
794
795 2020-05-18  Wenson Hsieh  <wenson_hsieh@apple.com>
796
797         [iOS] Unexpected capitalization of next word after repositioning caret
798         https://bugs.webkit.org/show_bug.cgi?id=211969
799         <rdar://problem/62605526>
800
801         Reviewed by Alex Christensen.
802
803         The changes in r242551 refactored synchronous autocorrection context request logic such that it uses
804         `waitForAndDispatchImmediately` instead of `sendSync`, in order to make it interruptible by unbounded sync IPC
805         sent from the web process. If the UI process receives sync IPC, it will immediately cancel the autocorrection
806         context request (returning an empty context), before proceeding to handle the incoming sync IPC.
807
808         In a more recent version of iOS, other changes around spellchecking have caused the synchronous message
809         `WebPageProxy::checkTextOfParagraph` to be sent from the web process in such a way that it now frequently
810         coincides with the synchronous autocorrection context request being sent from the UI process. The result is that
811         we now frequently end up cancelling autocorrection requests early by responding with empty contexts. This
812         manifests in the keyboard sometimes losing information about its autocapitalization context and believing that
813         it is in an empty text field, which reverts to default autocorrection suggestions and autocapitalizes the
814         software keyboard.
815
816         To fix this, instead of using the `InterruptWaitingIfSyncMessageArrives` option when waiting for the IPC
817         response, add and use a new flag that allows us to process an incoming sync IPC message if we're waiting for
818         the sync message response. We use this new IPC flag when waiting synchronously for HandleAutocorrectionContext.
819
820         Test: editing/selection/ios/changing-selection-does-not-trigger-autocapitalization.html
821
822         * Platform/IPC/Connection.cpp:
823         (IPC::Connection::processIncomingMessage):
824
825         If the new IPC flag is set and the incoming message is synchronous, allow it to immediately dispatch the sync
826         message by enqueueing it and then waking up `m_waitForMessageCondition` so that it can process the message.
827
828         * Platform/IPC/Connection.h:
829         * Platform/spi/ios/UIKitSPI.h:
830         * UIProcess/ios/WKContentViewInteraction.mm:
831         (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
832
833         Use `DispatchIncomingSyncMessagesWhileWaiting` instead of `InterruptWaitingIfSyncMessageArrives`.
834
835 2020-05-18  Lauro Moura  <lmoura@igalia.com>
836
837         webkitpy: Update test data after r261776
838         https://bugs.webkit.org/show_bug.cgi?id=212008
839
840         Reviewed by Alex Christensen.
841
842         Covered by existing tests.
843
844         * Scripts/test-legacyMessageReceiver.cpp:
845         * Scripts/test-legacyMessages.h:
846         (Messages::WebPage::DidCreateWebProcessConnection::DidCreateWebProcessConnection):
847         * Scripts/webkit/messages_unittest.py:
848         * Scripts/webkit/test-legacy.messages.in:
849
850 2020-05-18  Carlos Garcia Campos  <cgarcia@igalia.com>
851
852         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.29.1 release
853
854         * gtk/NEWS: Add release notes for 2.29.1.
855
856 2020-05-18  Carlos Garcia Campos  <cgarcia@igalia.com>
857
858         Move iOS files from Source/WebKit/Sources.txt to Source/WebKit/SourcesCocoa.txt
859         https://bugs.webkit.org/show_bug.cgi?id=212014
860
861         Unreviewed. Move platform specific files to the platform sources file.
862
863         * Sources.txt:
864         * SourcesCocoa.txt:
865
866 2020-05-18  Carlos Garcia Campos  <cgarcia@igalia.com>
867
868         [GTK] "ASSERTION FAILED: !m_adoptionIsRequired" when double clicking on a word
869         https://bugs.webkit.org/show_bug.cgi?id=211957
870
871         Reviewed by Adrian Perez de Castro.
872
873         Remove WebSelectionData wrapper since we can just encode/decode WebCore::SelectionData.
874
875         * Shared/WebCoreArgumentCoders.h:
876         * Shared/gtk/ArgumentCodersGtk.cpp:
877         (IPC::ArgumentCoder<SelectionData>::decode): Use modern decoder.
878         * Shared/gtk/ArgumentCodersGtk.h:
879         * Shared/gtk/WebSelectionData.cpp: Removed.
880         * Shared/gtk/WebSelectionData.h: Removed.
881         * SourcesGTK.txt:
882         * UIProcess/API/gtk/DragSource.h:
883         * UIProcess/API/gtk/DragSourceGtk3.cpp:
884         (WebKit::DragSource::DragSource):
885         (WebKit::DragSource::begin):
886         * UIProcess/API/gtk/DragSourceGtk4.cpp:
887         (WebKit::DragSource::begin):
888         * UIProcess/API/gtk/DropTarget.h:
889         * UIProcess/API/gtk/DropTargetGtk3.cpp:
890         (WebKit::DropTarget::accept):
891         (WebKit::DropTarget::enter):
892         (WebKit::DropTarget::update):
893         (WebKit::DropTarget::leaveTimerFired):
894         (WebKit::DropTarget::drop):
895         * UIProcess/API/gtk/PageClientImpl.cpp:
896         (WebKit::PageClientImpl::startDrag):
897         * UIProcess/API/gtk/PageClientImpl.h:
898         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
899         (webkitWebViewBaseStartDrag):
900         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
901         * UIProcess/PageClient.h:
902         * UIProcess/WebPageProxy.cpp:
903         (WebKit::WebPageProxy::performDragControllerAction):
904         (WebKit::WebPageProxy::startDrag):
905         * UIProcess/WebPageProxy.h:
906         * UIProcess/WebPageProxy.messages.in:
907         * UIProcess/WebPasteboardProxy.h:
908         * UIProcess/WebPasteboardProxy.messages.in:
909         * UIProcess/gtk/Clipboard.h:
910         * UIProcess/gtk/ClipboardGtk3.cpp:
911         (WebKit::WriteAsyncData::WriteAsyncData):
912         (WebKit::Clipboard::write):
913         * UIProcess/gtk/ClipboardGtk4.cpp:
914         (WebKit::Clipboard::write):
915         * UIProcess/gtk/WebPasteboardProxyGtk.cpp:
916         (WebKit::WebPasteboardProxy::writeToClipboard):
917         (WebKit::WebPasteboardProxy::writeCustomData):
918         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
919         (WebKit::WebPlatformStrategies::writeToClipboard):
920         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
921         (WebKit::WebDragClient::startDrag):
922         * WebProcess/WebPage/WebPage.cpp:
923         (WebKit::WebPage::performDragControllerAction):
924         * WebProcess/WebPage/WebPage.h:
925         * WebProcess/WebPage/WebPage.messages.in:
926
927 2020-05-18  Carlos Garcia Campos  <cgarcia@igalia.com>
928
929         [GTK] Add WebKitContextMenuItemType for paste as plaintext
930         https://bugs.webkit.org/show_bug.cgi?id=177638
931
932         Reviewed by Michael Catanzaro.
933
934         Add WEBKIT_CONTEXT_MENU_ACTION_PASTE_AS_PLAIN_TEXT.
935
936         * Shared/API/glib/WebKitContextMenuActions.cpp:
937         (webkitContextMenuActionGetActionTag):
938         (webkitContextMenuActionGetForContextMenuItem):
939         (webkitContextMenuActionGetLabel):
940         * UIProcess/API/gtk/WebKitContextMenuActions.h:
941         * UIProcess/gtk/KeyBindingTranslator.cpp:
942
943 2020-05-17  Carlos Garcia Campos  <cgarcia@igalia.com>
944
945         [GTK] Move to new Pasteboard API
946         https://bugs.webkit.org/show_bug.cgi?id=177633
947
948         Reviewed by Adrian Perez de Castro.
949
950         Enable custom pasteboard data.
951
952         * Shared/WebPreferencesDefaultValues.h:
953         * Shared/gtk/ArgumentCodersGtk.cpp:
954         (IPC::ArgumentCoder<SelectionData>::encode):
955         (IPC::ArgumentCoder<SelectionData>::decode):
956         * UIProcess/WebPasteboardProxy.cpp:
957         * UIProcess/gtk/ClipboardGtk3.cpp:
958         (WebKit::Clipboard::write): Add support for writing URI list and custom data.
959         * UIProcess/gtk/ClipboardGtk4.cpp:
960         (WebKit::Clipboard::write): Ditto.
961         * UIProcess/gtk/WebPasteboardProxyGtk.cpp:
962         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
963         (WebKit::WebPasteboardProxy::writeCustomData):
964
965 2020-05-16  Andy Estes  <aestes@apple.com>
966
967         REGRESSION (r260717): installmentConfiguration member is no longer available on ApplePayPaymentRequest
968         https://bugs.webkit.org/show_bug.cgi?id=211911
969         <rdar://problem/63236367>
970
971         Reviewed by Tim Horton.
972
973         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
974         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::encode):
975         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::decode):
976         (IPC::finishDecoding): Deleted.
977         (IPC::finishEncoding): Deleted.
978
979 2020-05-16  Yury Semikhatsky  <yurys@chromium.org>
980
981         [GTK] Do not leak pages created by window.open
982         https://bugs.webkit.org/show_bug.cgi?id=211970
983
984         Reviewed by Carlos Garcia Campos.
985
986         Previously webkitWebViewCreateNewPage created unbalanced refence to WebPageProxy and returned
987         it as a raw pointer. That raw pointer was later wrapped in a RefPtr in WebKitUIClient.
988         This change ensures that all refs are balanced by returnin RefPtr instead of
989         a raw pointer.
990
991         * UIProcess/API/glib/WebKitWebView.cpp:
992         (webkitWebViewCreateNewPage):
993         * UIProcess/API/glib/WebKitWebViewPrivate.h:
994
995 2020-05-15  Alex Christensen  <achristensen@webkit.org>
996
997         Use enum serialization instead of casting to/from uint32_t
998         https://bugs.webkit.org/show_bug.cgi?id=211885
999
1000         Reviewed by Geoffrey Garen.
1001
1002         * Scripts/webkit/messages.py:
1003         * Shared/DocumentEditingContext.h:
1004         * Shared/ios/GestureTypes.h:
1005         * UIProcess/API/C/WKAPICast.h:
1006         (WebKit::toWebGLLoadPolicy):
1007         (WebKit::toAPI):
1008         * UIProcess/Cocoa/NavigationState.mm:
1009         (WebKit::toWebCoreWebGLLoadPolicy):
1010         (WebKit::NavigationState::NavigationClient::webGLLoadPolicy const):
1011         (WebKit::NavigationState::NavigationClient::resolveWebGLLoadPolicy const):
1012         * UIProcess/WebPageProxy.cpp:
1013         (WebKit::WebPageProxy::webGLPolicyForURL):
1014         (WebKit::WebPageProxy::resolveWebGLPolicyForURL):
1015         * UIProcess/WebPageProxy.h:
1016         * UIProcess/WebPageProxy.messages.in:
1017         * UIProcess/ios/WKContentViewInteraction.mm:
1018         (-[WKContentView selectForWebView:]):
1019         (toUIWKSelectionFlags):
1020         (toSelectionFlags):
1021         (toWKTextGranularity):
1022         (toWKSelectionDirection):
1023         (selectionChangedWithGesture):
1024         (selectionChangedWithTouch):
1025         (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:withFlags:]):
1026         (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:withFlags:]):
1027         (-[WKContentView changeSelectionWithTouchesFrom:to:withGesture:withState:]):
1028         (-[WKContentView selectWordForReplacement]):
1029         * UIProcess/ios/WebPageProxyIOS.mm:
1030         (WebKit::WebPageProxy::gestureCallback):
1031         (WebKit::WebPageProxy::touchesCallback):
1032         (WebKit::WebPageProxy::selectWithGesture):
1033         (WebKit::WebPageProxy::updateSelectionWithTouches):
1034         (WebKit::WebPageProxy::selectTextWithGranularityAtPoint):
1035         (WebKit::WebPageProxy::selectPositionAtBoundaryWithDirection):
1036         (WebKit::WebPageProxy::moveSelectionAtBoundaryWithDirection):
1037         (WebKit::WebPageProxy::selectWithTwoTouches):
1038         (WebKit::WebPageProxy::extendSelection):
1039         (WebKit::WebPageProxy::requestRectsForGranularityWithSelectionOffset):
1040         * WebProcess/InjectedBundle/API/mac/WKDOMRange.mm:
1041         (-[WKDOMRange rangeByExpandingToWordBoundaryByCharacters:inDirection:]):
1042         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1043         (WebKit::WebFrameLoaderClient::webGLPolicyForURL const):
1044         (WebKit::WebFrameLoaderClient::resolveWebGLPolicyForURL const):
1045         * WebProcess/WebPage/WebPage.cpp:
1046         (WebKit::WebPage::webGLPolicyForURL):
1047         (WebKit::WebPage::resolveWebGLPolicyForURL):
1048         * WebProcess/WebPage/WebPage.h:
1049         * WebProcess/WebPage/WebPage.messages.in:
1050         * WebProcess/WebPage/ios/WebPageIOS.mm:
1051         (WebKit::WebPage::getPlatformEditorState const):
1052         (WebKit::WebPage::getSelectionContext):
1053         (WebKit::WebPage::selectWithGesture):
1054         (WebKit::rangeAtWordBoundaryForPosition):
1055         (WebKit::WebPage::updateSelectionWithTouches):
1056         (WebKit::WebPage::selectWithTwoTouches):
1057         (WebKit::WebPage::extendSelection):
1058         (WebKit::WebPage::selectWordBackward):
1059         (WebKit::WebPage::moveSelectionByOffset):
1060         (WebKit::WebPage::getRectsForGranularityWithSelectionOffset):
1061         (WebKit::WebPage::selectPositionAtBoundaryWithDirection):
1062         (WebKit::WebPage::moveSelectionAtBoundaryWithDirection):
1063         (WebKit::WebPage::rangeForGranularityAtPoint):
1064         (WebKit::WebPage::selectTextWithGranularityAtPoint):
1065         (WebKit::WebPage::beginSelectionInDirection):
1066         (WebKit::WebPage::updateSelectionWithExtentPointAndBoundary):
1067         (WebKit::WebPage::requestDictationContext):
1068         (WebKit::WebPage::applyAutocorrectionInternal):
1069         (WebKit::WebPage::autocorrectionContext):
1070         (WebKit::dataDetectorLinkPositionInformation):
1071         (WebKit::moveByGranularityRespectingWordBoundary):
1072         (WebKit::WebPage::requestDocumentEditingContext):
1073         * WebProcess/WebPage/mac/WebPageMac.mm:
1074         (WebKit::WebPage::webGLPolicyForURL):
1075         (WebKit::WebPage::resolveWebGLPolicyForURL):
1076
1077 2020-05-15  Alex Christensen  <achristensen@webkit.org>
1078
1079         [iOS Simulator] TestWebKitAPI._WKDownload.Resume is a flaky crash
1080         https://bugs.webkit.org/show_bug.cgi?id=211786
1081
1082         Reviewed by Geoffrey Garen.
1083
1084         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1085         (-[WKNetworkSessionDelegate URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:]):
1086
1087 2020-05-15  Alex Christensen  <achristensen@webkit.org>
1088
1089         Regression (iOS 13.4, r249142): WKWebView.loading is never reset after a Back navigation in an iframe
1090         https://bugs.webkit.org/show_bug.cgi?id=211449
1091
1092         Reviewed by Geoffrey Garen.
1093
1094         Always call clearPendingAPIRequest in WebPageProxy::didStartProvisionalLoadForFrameShared.
1095         r249142 regressed this and caused more "loading appears to continue forever" bugs fixed in r249890.
1096         This should fix both, by removing the problematic half of r249142.
1097
1098         Covered by an API test.
1099
1100         * UIProcess/WebPageProxy.cpp:
1101         (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
1102
1103 2020-05-15  Adrian Perez de Castro  <aperez@igalia.com>
1104
1105         [GTK3] Bring back usage of GtkMenu for context menus
1106         https://bugs.webkit.org/show_bug.cgi?id=211557
1107
1108         Reviewed by Carlos Garcia Campos.
1109
1110         * UIProcess/API/glib/WebKitWebView.cpp:
1111         (contextMenuDismissed): Removed.
1112         (webkitWebViewPopulateContextMenu): Use WebContextMenuProxyGtk::widgetDismissedSignal
1113         and move the code from contextMenuDismissed() into an inline lambda.
1114         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1115         (activeContextMenuClosed): Removed.
1116         (webkitWebViewBaseSetActiveContextMenuProxy): Use WebContextMenuProxyGtk::widgetDismissedSignal
1117         and move the code from activeContextMenuClosed() into an inline lambda.
1118         * UIProcess/gtk/WebContextMenuProxyGtk.cpp: Add helper functions to manipulate the actual
1119         widget used for context menus depending on whether GTK3 or GTK4 is being used. The GTK3
1120         versions bring back bits of code removed in r260889.
1121         (WebKit::createMenuWidget): Added.
1122         (WebKit::popupMenuWidget): Added.
1123         (WebKit::popdownMenuWidget): Added.
1124         (WebKit::menuWidgetHasItems): Added.
1125         (WebKit::bindModelToMenuWidget): Added.
1126         (WebKit::WebContextMenuProxyGtk::populate): Use context menu widget helper functions.
1127         (WebKit::WebContextMenuProxyGtk::showContextMenuWithItems): Ditto.
1128         (WebKit::WebContextMenuProxyGtk::WebContextMenuProxyGtk): Ditto. Also handle the
1129         signal triggered when the context menu is dismissed and arrange to call
1130         webkitWebViewContextMenuDismissed() and webkitWebViewBaseContextMenuDismissed().
1131         (WebKit::WebContextMenuProxyGtk::~WebContextMenuProxyGtk): Use helper functions.
1132         * UIProcess/gtk/WebContextMenuProxyGtk.h: Add WebContextMenuProxyGtk::widgetDismissedSignal
1133         constant.
1134
1135 2020-05-14  Kate Cheney  <katherine_cheney@apple.com>
1136
1137         Attribute non-network loads and loads with html strings as automatically app-bound
1138         https://bugs.webkit.org/show_bug.cgi?id=211913
1139         <rdar://problem/63157801
1140
1141         Reviewed by Brent Fulgham.
1142
1143         Move logic from WebsiteDataStoreCocoa to WebPageProxy to check for
1144         special app-bound protocols and set m_limitsNavigationToAppBoundDomains
1145         to force these WebViews into app-bound mode.
1146
1147         * UIProcess/API/Cocoa/WKWebView.mm:
1148         (-[WKWebView _isForcedIntoAppBoundMode:]):
1149         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1150         Testing SPI to see whether m_limitsNavigationsToAppBoundDomains was
1151         set.
1152
1153         * UIProcess/WebPageProxy.cpp:
1154         (WebKit::WebPageProxy::loadData):
1155         Check for html string loads and force WebView into app-bound mode if needed.
1156         No need to worry about setting this variable even if the app hasn't
1157         opted in because setIsNavigatingToAppBoundDomainAndCheckIfPermitted
1158         does an early return before checking this variable if
1159         WKAppBoundDomains does not exist.
1160
1161         (WebKit::shouldTreatURLProtocolAsAppBound):
1162         Adds javascript protocols to this check.
1163
1164         (WebKit::WebPageProxy::setIsNavigatingToAppBoundDomainAndCheckIfPermitted):
1165         Check for special protocols here and force WebView into app-bound mode.
1166
1167         (WebKit::WebPageProxy::isForcedIntoAppBoundModeTesting):
1168         * UIProcess/WebPageProxy.h:
1169         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
1170         (WebKit::WebsiteDataStore::beginAppBoundDomainCheck):
1171         (WebKit::shouldTreatURLProtocolAsAppBound): Deleted.
1172
1173 2020-05-14  Timothy Hatcher  <timothy@apple.com>
1174
1175         Add baseURL version of _WKUserStyleSheet forWKWebView.
1176         https://bugs.webkit.org/show_bug.cgi?id=211926
1177         rdar://problem/62074675
1178
1179         Reviewed by Devin Rousso.
1180
1181         * UIProcess/API/Cocoa/_WKUserStyleSheet.h:
1182         * UIProcess/API/Cocoa/_WKUserStyleSheet.mm:
1183         (-[_WKUserStyleSheet initWithSource:forWKWebView:forMainFrameOnly:baseURL:level:userContentWorld:]): Added.
1184         (-[_WKUserStyleSheet initWithSource:forWKWebView:forMainFrameOnly:level:userContentWorld:]): Clean up WebCore::UserStyleSheet initializer.
1185         (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:]): Ditto.
1186         (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:userContentWorld:]): Ditto.
1187         (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:baseURL:userContentWorld:]): Ditto.
1188         (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:baseURL:level:userContentWorld:]): Ditto.
1189
1190 2020-05-14  John Wilander  <wilander@apple.com>
1191
1192         Add quirk for cookie blocking latch mode aolmail.com redirecting to aol.com under aol.com
1193         https://bugs.webkit.org/show_bug.cgi?id=211925
1194         <rdar://problem/61901041>
1195
1196         Reviewed by Brent Fulgham.
1197
1198         No new tests. Just a new quirk for a pair of domains added by request.
1199
1200         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1201         (WebKit::NetworkDataTaskCocoa::needsFirstPartyCookieBlockingLatchModeQuirk const):
1202
1203 2020-05-14  Chris Dumez  <cdumez@apple.com>
1204
1205         Regression(r261163) Causes crashes on builds without libwebrtc.dylib
1206         https://bugs.webkit.org/show_bug.cgi?id=211924
1207         <rdar://problem/63206792>
1208
1209         Reviewed by Jer Noble.
1210
1211         * WebProcess/Network/NetworkProcessConnection.cpp:
1212         (WebKit::NetworkProcessConnection::NetworkProcessConnection):
1213
1214 2020-05-14  Timothy Hatcher  <timothy@apple.com>
1215
1216         Add sourceURL to _evaluateJavaScript: so the scripts appear in Web Inspector.
1217         https://bugs.webkit.org/show_bug.cgi?id=211904
1218         rdar://problem/62074376
1219
1220         Reviewed by Devin Rousso.
1221
1222         Added sourceURL version of _evaluateJavaScript: that passes the sourceURL to RunJavaScriptParameters.
1223         If the sourceURL is invalid, generate a unique user script URL so the source code errors are not showing
1224         up with the frame's document URL and bogus locations.
1225
1226         * UIProcess/API/C/WKPage.cpp:
1227         (WKPageRunJavaScriptInMainFrame): pass API::UserScript::generateUniqueURL() for the sourceURL.
1228         * UIProcess/API/Cocoa/WKUserScript.mm:
1229         (-[WKUserScript initWithSource:injectionTime:forMainFrameOnly:]): Clean up WebCore::UserScript initializer.
1230         (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:userContentWorld:]): Ditto.
1231         (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:associatedURL:userContentWorld:]): Ditto.
1232         (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:contentWorld:]): Ditto.
1233         (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:associatedURL:contentWorld:]): Ditto.
1234         (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:associatedURL:contentWorld:deferRunningUntilNotification:]): Ditto.
1235         * UIProcess/API/Cocoa/WKWebView.mm:
1236         (-[WKWebView _evaluateJavaScript:asAsyncFunction:withArguments:forceUserGesture:inFrame:inWorld:completionHandler:]): Renamed to add sourceURL.
1237         (-[WKWebView _evaluateJavaScript:asAsyncFunction:withSourceURL:withArguments:forceUserGesture:inFrame:inWorld:completionHandler:]): Added sourceURL.
1238         (-[WKWebView _evaluateJavaScript:withSourceURL:inFrame:inContentWorld:completionHandler:]): Added. Pass sourceURL through.
1239         (-[WKWebView evaluateJavaScript:completionHandler:]): Call new method with sourceURL as nil.
1240         (-[WKWebView evaluateJavaScript:inContentWorld:completionHandler:]): Ditto.
1241         (-[WKWebView callAsyncJavaScript:arguments:inContentWorld:completionHandler:]): Ditto.
1242         (-[WKWebView _callAsyncJavaScript:arguments:inFrame:inContentWorld:completionHandler:]): Ditto.
1243         (-[WKWebView _evaluateJavaScript:inFrame:inContentWorld:completionHandler:]): Ditto.
1244         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1245
1246 2020-05-14  Chris Dumez  <cdumez@apple.com>
1247
1248         WebsiteDataStore functions should only send IPC to WebProcesses that are associated with its session
1249         https://bugs.webkit.org/show_bug.cgi?id=211917
1250
1251         Reviewed by Alex Christensen.
1252
1253         WebsiteDataStore functions should only send IPC to WebProcesses that are associated with its session.
1254         setResourceLoadStatisticsEnabled() / clearResourceLoadStatisticsInWebProcesses() were talking to all
1255         WebProcesses, even those associated with other sessions, which was wrong.
1256
1257         * UIProcess/WebProcessPool.cpp:
1258         (WebKit::WebProcessPool::clearResourceLoadStatistics): Deleted.
1259         * UIProcess/WebProcessPool.h:
1260         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1261         (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
1262         (WebKit::WebsiteDataStore::clearResourceLoadStatisticsInWebProcesses):
1263
1264 2020-05-14  Daniel Bates  <dabates@apple.com>
1265
1266         [iOS] Remove dead dictation code
1267         https://bugs.webkit.org/show_bug.cgi?id=211871
1268
1269         Reviewed by Wenson Hsieh.
1270
1271         UIKit has long removed all callers that would call -nextUnperturbedDictationResultBoundaryFromPosition
1272         and -previousUnperturbedDictationResultBoundaryFromPosition. So, remove the implementations.
1273
1274         * UIProcess/ios/WKContentViewInteraction.mm:
1275         (-[WKContentView previousUnperturbedDictationResultBoundaryFromPosition:]): Deleted.
1276         (-[WKContentView nextUnperturbedDictationResultBoundaryFromPosition:]): Deleted.
1277
1278 2020-05-14  Brady Eidson  <beidson@apple.com>
1279
1280         Crash in PDFPlugin::ensureDataBufferLength
1281         <rdar://problem/62932155> and https://bugs.webkit.org/show_bug.cgi?id=211818
1282
1283         Reviewed by Tim Horton.
1284
1285         There's some currently unreproducible case(s) where a range request finishes
1286         while there's no m_data to append it to.
1287         
1288         It's fair hardening to handle that case.
1289
1290         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1291         (WebKit::PDFPlugin::getResourceBytesAtPositionMainThread): Handle null m_data.
1292         (WebKit::PDFPlugin::ensureDataBufferLength): Ditto.
1293
1294 2020-05-14  Per Arne Vollan  <pvollan@apple.com>
1295
1296         [iOS] Update message filtering rules in the WebContent process' sandbox
1297         https://bugs.webkit.org/show_bug.cgi?id=211188
1298
1299         Reviewed by Brent Fulgham.
1300
1301         Based on telemetry and local testing, update the message filtering rules in the WebContent process' sandbox on iOS.
1302         Messages that have not been observed being in use, should be denied.
1303
1304         No new tests, covered by existing tests.
1305
1306         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1307
1308 2020-05-14  Adrian Perez de Castro  <aperez@igalia.com>
1309
1310         Non-unified build fixed, mid May 2020 edition
1311         https://bugs.webkit.org/show_bug.cgi?id=211859
1312
1313         Unreviewed build fix.
1314
1315         * UIProcess/gtk/Clipboard.cpp: Add missing includes for <mutex>, wtf/NeverDestroyed.h, and
1316         wtf/text/WTFString.h.
1317         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: Add missing
1318         SharedBufferDataReference.h include.
1319         * WebProcess/WebCoreSupport/WebPlatformStrategies.h: Add missing namespace to usage of
1320         the WebCore::SharedBuffer type.
1321
1322 2020-05-13  David Kilzer  <ddkilzer@apple.com>
1323
1324         [IPC] Use templates to reduce duplicate code in IPC::Decoder and IPC::Encoder classes
1325         <https://webkit.org/b/211861>
1326         <rdar://problem/62360390>
1327
1328         Reviewed by Alex Christensen.
1329
1330         In broad strokes, this change fixes the following issues:
1331         - Change `unsigned` type to `size_t` for `alignment` parameters
1332           for consistency on 32-bit platforms.
1333         - Templatize Encoder::encode(), Decoder::decode() and
1334           Decoder::operator>>() methods to reduce duplicate code.  This
1335           deleted code in source files, added template methods to header
1336           files, and required a few changes to existing templates in
1337           header files to disambiguate std::is_arithmetic parameter
1338           types.
1339         - Use `typename E` for all template methods that handle enum
1340           types.
1341         - Use `typename T` for all other template method types.
1342         - Move WARN_UNUSED_RETURN to same line as `bool` return type.
1343         - Add FIXME comments to validate enum values.
1344
1345         * Platform/IPC/Decoder.cpp:
1346         (IPC::roundUpToAlignment):
1347         (IPC::Decoder::alignBufferPosition):
1348         (IPC::Decoder::bufferIsLargeEnoughToContain const):
1349         (IPC::Decoder::decodeFixedLengthData):
1350         (IPC::decodeValueFromBuffer): Delete.
1351         (IPC::Decoder::getOptional): Delete.
1352         (IPC::Decoder::operator>>): Delete.
1353         (IPC::Decoder::decode): Delete.
1354         * Platform/IPC/Decoder.h:
1355         (IPC::Decoder::decode):
1356         (IPC::Decoder::operator>>):
1357         (IPC::Decoder::decodeEnum):
1358         * Platform/IPC/Encoder.cpp:
1359         (IPC::roundUpToAlignment):
1360         (IPC::Encoder::grow):
1361         (IPC::Encoder::encodeFixedLengthData):
1362         (IPC::copyValueToBuffer): Delete.
1363         (IPC::Encoder::encode): Delete.
1364         * Platform/IPC/Encoder.h:
1365
1366 2020-05-13  Devin Rousso  <drousso@apple.com>
1367
1368         Web Inspector: `RuntimeEnabledFeatures` should also be enabled when remotely inspecting
1369         https://bugs.webkit.org/show_bug.cgi?id=211874
1370
1371         Reviewed by Timothy Hatcher.
1372
1373         * WebProcess/Inspector/WebInspectorUI.h:
1374         * WebProcess/Inspector/WebInspectorUI.cpp:
1375         (WebKit::WebInspectorUI::enableFrontendFeatures): Added.
1376         (WebKit::WebInspectorUI::WebInspectorUI):
1377         * WebProcess/Inspector/RemoteWebInspectorUI.cpp:
1378         (WebKit::RemoteWebInspectorUI::RemoteWebInspectorUI):
1379
1380 2020-05-13  Megan Gardner  <megan_gardner@apple.com>
1381
1382         Unreviewed Build Fix.
1383
1384         * UIProcess/ios/PageClientImplIOS.mm:
1385         (WebKit::PageClientImpl::setMouseEventPolicy):
1386         * UIProcess/ios/forms/WKDateTimeInputControl.mm:
1387         (-[WKDateTimePicker dealloc]):
1388         (-[WKDateTimePicker controlBeginEditing]):
1389         (-[WKDateTimePicker controlEndEditing]):
1390
1391 2020-05-13  Kate Cheney  <katherine_cheney@apple.com>
1392
1393         SHOULD NEVER BE REACHED in WebKit::ResourceLoadStatisticsDatabaseStore::openAndUpdateSchemaIfNecessary
1394         https://bugs.webkit.org/show_bug.cgi?id=211637
1395         <rdar://problem/63031185>
1396
1397         Reviewed by John Wilander.
1398
1399         No new tests, behavior confirmed by existing tests.
1400
1401         Stop reseting ITP to use the memory store between tests. This results
1402         in consecutive calls to NetworkSession::recreateResourceLoadStatisticStore
1403         if two database tests occur in a row, which can set the m_resourceLoadStatistics
1404         object before a previous call to WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore
1405         is done.
1406
1407         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1408         (WKWebsiteDataStoreStatisticsResetToConsistentState):
1409
1410 2020-05-13  Megan Gardner  <megan_gardner@apple.com>
1411
1412         Change Date/Time popovers to contextMenus.
1413         https://bugs.webkit.org/show_bug.cgi?id=211825
1414         <rdar://problem/63102524>
1415
1416         Reviewed by Wenson Hsieh.
1417
1418         Update the Date/Time picker to use UIContextMenus instead of popovers.
1419         Removed all the unneeded popover code.
1420         Renamed WKFormInputControl to WKDateTimeInputControl because it was only used
1421         for date and time controls, unneccessary abstraction.
1422         We need to ensure the poisition information is up to date before presenting
1423         the context menu, or the position it will be presented from can be stale.
1424
1425         * SourcesCocoa.txt:
1426         * UIProcess/ios/WKContentViewInteraction.h:
1427         * UIProcess/ios/WKContentViewInteraction.mm:
1428         (-[WKContentView _shouldShowAutomaticKeyboardUIIgnoringInputMode]):
1429         (-[WKContentView requiresAccessoryView]):
1430         (-[WKContentView _updateAccessory]):
1431         (mayContainSelectableText):
1432         (createInputPeripheralWithView):
1433         (-[WKContentView inputLabelText]):
1434         (-[WKContentView _removeContextMenuViewIfPossible]):
1435         (-[WKContentView inputLabelTextForViewController:]):
1436         (-[WKContentView formInputControl]):
1437         (-[WKContentView setTimePickerValueToHour:minute:]):
1438         (-[WKContentView timePickerValueHour]):
1439         (-[WKContentView timePickerValueMinute]):
1440         * UIProcess/ios/forms/WKDateTimeInputControl.h: Renamed from Source/WebKit/UIProcess/ios/forms/WKFormInputControl.h.
1441         * UIProcess/ios/forms/WKDateTimeInputControl.mm: Renamed from Source/WebKit/UIProcess/ios/forms/WKFormInputControl.mm.
1442         (-[WKDateTimeContextMenuViewController init]):
1443         (-[WKDateTimeContextMenuViewController preferredContentSize]):
1444         (-[WKDateTimePicker initWithView:datePickerMode:]):
1445         (-[WKDateTimePicker contextMenuInteraction:previewForHighlightingMenuWithConfiguration:]):
1446         (-[WKDateTimePicker _contextMenuInteraction:styleForMenuWithConfiguration:]):
1447         (-[WKDateTimePicker contextMenuInteraction:configurationForMenuAtLocation:]):
1448         (-[WKDateTimePicker contextMenuInteraction:willEndForConfiguration:animator:]):
1449         (-[WKDateTimePicker removeContextMenuInteraction]):
1450         (-[WKDateTimePicker ensureContextMenuInteraction]):
1451         (-[WKDateTimePicker showDateTimePicker]):
1452         (-[WKDateTimePicker reset:]):
1453         (-[WKDateTimePicker calendarType]):
1454         (-[WKDateTimePicker dealloc]):
1455         (-[WKDateTimePicker setDateTimePickerToInitialValue]):
1456         (-[WKDateTimePicker controlBeginEditing]):
1457         (-[WKDateTimePicker viewController]):
1458         (-[WKDateTimePicker controlEndEditing]):
1459         (-[WKDateTimeInputControl initWithView:]):
1460         (-[WKDateTimeInputControl setTimePickerHour:minute:]):
1461         (-[WKDateTimeInputControl dateTimePickerCalendarType]):
1462         (-[WKDateTimeInputControl timePickerValueHour]):
1463         (-[WKDateTimeInputControl timePickerValueMinute]):
1464         * WebKit.xcodeproj/project.pbxproj:
1465
1466 2020-05-13  Wenson Hsieh  <wenson_hsieh@apple.com>
1467
1468         Unreviewed, fix tvOS and watchOS builds after r261638
1469
1470         `-[UIPasteboard itemProviders]` is not present on watchOS and tvOS.
1471
1472         * UIProcess/ios/WKContentViewInteraction.mm:
1473         (-[WKContentView _writePromisedAttachmentToPasteboard:]):
1474
1475 2020-05-13  Timothy Horton  <timothy_horton@apple.com>
1476
1477         Build fix.
1478
1479         * UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h:
1480
1481 2020-05-13  Jer Noble  <jer.noble@apple.com>
1482
1483         Replace isNullFunctionPointer with real weak-linking support
1484         https://bugs.webkit.org/show_bug.cgi?id=211751
1485
1486         Reviewed by Sam Weinig.
1487
1488         Use the new WTF_WEAK_LINK_FORCE_IMPORT macro.
1489
1490         * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp:
1491         (WebKit::ResourceLoadStatisticsClassifierCocoa::canUseCorePrediction):
1492
1493 2020-05-13  Tim Horton  <timothy_horton@apple.com>
1494
1495         Add SPI for reverting to touch events for iPad trackpad interactions
1496         https://bugs.webkit.org/show_bug.cgi?id=211824
1497         <rdar://problem/61363084>
1498
1499         Reviewed by Megan Gardner.
1500
1501         New Test: IOSMouseSupport.WebsiteMouseEventPolicies
1502
1503         Plumb a "mouse event policy" WKWebpagePreference, which has two values:
1504
1505         - Default, which means that WebKit decides whether or not indirect
1506         pointing devices send mouse or touch events.
1507
1508         - SynthesizeTouchEvents, which ensures that WebKit will always send
1509         touch events from indirect pointing devices.
1510         This value is only available on platforms that implement touch events.
1511
1512         We use the WKWebpagePreferences mechanism in order to make it easy to
1513         implement it as a "per-site" quirk, but unlike most WKWebpagePreferences,
1514         it turns around and changes UI process state (the enablement of the
1515         WKMouseGestureRecgonizer).
1516
1517         * Scripts/webkit/messages.py:
1518         * Shared/WebsitePoliciesData.cpp:
1519         (WebKit::WebsitePoliciesData::encode const):
1520         (WebKit::WebsitePoliciesData::decode):
1521         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
1522         * Shared/WebsitePoliciesData.h:
1523         * UIProcess/API/APIWebsitePolicies.cpp:
1524         (API::WebsitePolicies::copy const):
1525         (API::WebsitePolicies::data):
1526         * UIProcess/API/APIWebsitePolicies.h:
1527         * UIProcess/API/Cocoa/WKWebpagePreferences.mm:
1528         (WebKit::mouseEventPolicy):
1529         (WebKit::coreMouseEventPolicy):
1530         (-[WKWebpagePreferences _setMouseEventPolicy:]):
1531         (-[WKWebpagePreferences _mouseEventPolicy]):
1532         * UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h:
1533         * UIProcess/PageClient.h:
1534         (WebKit::PageClient::setMouseEventPolicy):
1535         * UIProcess/ProvisionalPageProxy.cpp:
1536         (WebKit::ProvisionalPageProxy::didCommitLoadForFrame):
1537         * UIProcess/ProvisionalPageProxy.h:
1538         * UIProcess/WebPageProxy.cpp:
1539         (WebKit::WebPageProxy::commitProvisionalPage):
1540         (WebKit::WebPageProxy::didCommitLoadForFrame):
1541         * UIProcess/WebPageProxy.h:
1542         * UIProcess/WebPageProxy.messages.in:
1543         * UIProcess/ios/PageClientImplIOS.h:
1544         * UIProcess/ios/PageClientImplIOS.mm:
1545         (WebKit::PageClientImpl::setMouseEventPolicy):
1546         * UIProcess/ios/WKContentViewInteraction.h:
1547         * UIProcess/ios/WKContentViewInteraction.mm:
1548         (-[WKContentView shouldUseMouseGestureRecognizer]):
1549         (-[WKContentView setUpMouseGestureRecognizer]):
1550         (-[WKContentView _configureMouseGestureRecognizer]):
1551         (-[WKContentView _setMouseEventPolicy:]):
1552         * UIProcess/ios/WKMouseGestureRecognizer.mm:
1553         (-[WKMouseGestureRecognizer setEnabled:]):
1554         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1555         (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
1556
1557 2020-05-13  Wenson Hsieh  <wenson_hsieh@apple.com>
1558
1559         [iOS] "Copy" context menu action for attachment element does not work in Mail
1560         https://bugs.webkit.org/show_bug.cgi?id=211817
1561         <rdar://problem/58043110>
1562
1563         Reviewed by Tim Horton.
1564
1565         Implements support for copying an attachment element, via context menu actions. To achieve this, we first
1566         refactor code in WebCore that is currently responsible for converting an attachment element into a
1567         PromisedAttachmentInfo, which provides a handle to an UI-process-side API attachment object. We then use this
1568         helper in WebKit to send PromisedAttachmentInfo back to the UI process when handling the copy action from the
1569         context menu on iOS.
1570
1571         On iOS, we then take this promised attachment info in the UI process, map it to an API::Attachment object, and
1572         use the file handle to create and write an NSItemProvider to the general pasteboard. (In the future, similar
1573         logic could be implemented on macOS as well to handle copying attachment elements by implementing a version of
1574         writePromisedAttachmentToPasteboard in PageClientImplMac. Currently, we fall back to treating this case as if
1575         we're copying a text selection containing a single attachment element).
1576
1577         * UIProcess/API/ios/WKWebViewPrivateForTestingIOS.h:
1578
1579         Add a new helper function to simulate an element action (_WKElementActionType) for an element at the given
1580         location. This is used by the new API test.
1581
1582         * UIProcess/API/ios/WKWebViewTestingIOS.mm:
1583         (-[WKWebView _simulateElementAction:atLocation:]):
1584         * UIProcess/PageClient.h:
1585         (WebKit::PageClient::writePromisedAttachmentToPasteboard):
1586         * UIProcess/WebPageProxy.cpp:
1587         (WebKit::WebPageProxy::writePromisedAttachmentToPasteboard):
1588         * UIProcess/WebPageProxy.h:
1589         * UIProcess/WebPageProxy.messages.in:
1590
1591         Add an IPC message for the UI process to receive a PromisedAttachmentInfo, and copy it to the system pasteboard
1592         if it maps to an actual API::Attachment. For now, we only support copying data if the attachment is backed by
1593         a file wrapper in the UI process (as opposed to blob data written by the web process).
1594
1595         * UIProcess/ios/PageClientImplIOS.h:
1596         * UIProcess/ios/PageClientImplIOS.mm:
1597         (WebKit::PageClientImpl::writePromisedAttachmentToPasteboard):
1598         * UIProcess/ios/WKContentViewInteraction.h:
1599         * UIProcess/ios/WKContentViewInteraction.mm:
1600         (createItemProvider):
1601
1602         Create a helper function to convert PromisedAttachmentInfo into an NSItemProvider. This is similar to
1603         `-_prepareToDragPromisedAttachment:`, but with a couple differences: (1) we only create an NSItemProvider
1604         instead of going through `WebItemProviderRegistrationInfoList`; (2) since there's no opportunity to clean up
1605         temporary after pasting, serialize the attachment data using `-serializedRepresentation`, and provide the
1606         attachment data instead of a file URL.
1607
1608         Ideally, we would offer the data directly to the pasteboard so that even if Mail terminates, the contents of the
1609         pasteboard can still be provided when pasting; however, it doesn't seem like we can do this while being able to
1610         offer a suggested name for the item we're writing. Some other apps work around this limitation by writing the
1611         file name as plain text on the pasteboard, but this doesn't work then attempting to copy a plain text file that
1612         has a file name.
1613
1614         (-[WKContentView _writePromisedAttachmentToPasteboard:]):
1615         (-[WKContentView _simulateElementAction:atLocation:]):
1616         * WebProcess/WebPage/ios/WebPageIOS.mm:
1617         (WebKit::WebPage::performActionOnElement):
1618
1619 2020-05-13  Per Arne Vollan  <pvollan@apple.com>
1620
1621         [iOS] Update message filtering rules in the WebContent process' sandbox
1622         https://bugs.webkit.org/show_bug.cgi?id=211188
1623
1624         Reviewed by Brent Fulgham.
1625
1626         Based on telemetry and local testing, update the message filtering rules in the WebContent process' sandbox on iOS.
1627         Messages that have not been observed being in use, should be denied.
1628
1629         No new tests, covered by existing tests.
1630
1631         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1632
1633 2020-05-13  Per Arne Vollan  <pvollan@apple.com>
1634
1635         [iOS] In CFPrefs direct mode, the WebContent sandbox needs to allow access to plist files
1636         https://bugs.webkit.org/show_bug.cgi?id=211782
1637
1638         Reviewed by Brent Fulgham.
1639
1640         Since preference files will be read directly in CFPrefs direct mode, the WebContent sandbox on iOS needs to allow reading these files.
1641
1642         No new tests. There is API test coverage for this in PreferenceChanges.mm, but these tests are only run on simulator, not device.
1643
1644         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1645
1646 2020-05-13  Peng Liu  <peng.liu6@apple.com>
1647
1648         Add the feature flags plist file back
1649         https://bugs.webkit.org/show_bug.cgi?id=211816
1650
1651         Reviewed by Jer Noble.
1652
1653         Add the WebKit.plist file to the WebKit project and use it instead of the one from the WebKitAdditions.
1654
1655         * FeatureFlags/WebKit.plist: Added.
1656         * WebKit.xcodeproj/project.pbxproj:
1657
1658 2020-05-13  Youenn Fablet  <youenn@apple.com>
1659
1660         Allow WebAudioBufferList to dynamically change its number of frames
1661         https://bugs.webkit.org/show_bug.cgi?id=211720
1662
1663         Reviewed by Eric Carlson.
1664
1665         * WebProcess/cocoa/RemoteCaptureSampleManager.cpp:
1666         (WebKit::RemoteCaptureSampleManager::RemoteAudio::setStorage):
1667         (WebKit::RemoteCaptureSampleManager::RemoteAudio::audioSamplesAvailable):
1668         * WebProcess/cocoa/RemoteCaptureSampleManager.h:
1669
1670 2020-05-13  Per Arne Vollan  <pvollan@apple.com>
1671
1672         Unreviewed compile fix after r261584.
1673
1674         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1675         (WebKit::WebProcessPool::platformInitializeWebProcess):
1676
1677 2020-05-13  Chris Dumez  <cdumez@apple.com>
1678
1679         REGRESSION (r261254): Broke Apple Pay on macOS
1680         https://bugs.webkit.org/show_bug.cgi?id=211826
1681         <rdar://problem/63161750>
1682
1683         Reviewed by Alex Christensen.
1684
1685         r261254 dropped the code needed to add the WebPaymentCoordinatorProxy as an IPC message receiver.
1686         This patch re-introduces the code in order to address the regression.
1687
1688         No new tests, tested manually on https://applepaydemo.apple.com.
1689
1690         * NetworkProcess/NetworkConnectionToWebProcess.h:
1691         * NetworkProcess/ios/NetworkConnectionToWebProcessIOS.mm:
1692         (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorAddMessageReceiver):
1693         (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorRemoveMessageReceiver):
1694         * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
1695         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1696         (WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy):
1697         (WebKit::WebPaymentCoordinatorProxy::~WebPaymentCoordinatorProxy):
1698         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
1699         (WebKit::WebPageProxy::paymentCoordinatorAddMessageReceiver):
1700         (WebKit::WebPageProxy::paymentCoordinatorRemoveMessageReceiver):
1701         * UIProcess/WebPageProxy.h:
1702
1703 2020-05-13  Zan Dobersek  <zdobersek@igalia.com>
1704
1705         REGRESSION(r260571): RequestedScrollPosition doesn't have its scroll change applied to layers anymore
1706         https://bugs.webkit.org/show_bug.cgi?id=211374
1707
1708         Reviewed by Carlos Garcia Campos.
1709
1710         Use WebPage::finalizeRenderingUpdate() to perform the compositing state flush
1711         and the scrolling tree layer positioning, instead of doing things half-baked
1712         by manually invoking the FrameView method.
1713
1714         Additional WebPage calls (updateRendering(), flushPendingEditorStateUpdate())
1715         are moved into CompositingCoordinator::flushPendingLayerChanges() from the
1716         LayerTreeHost::layerFlushTimerFired() method for consistency. The additional
1717         CompositingCoordinator::syncDisplayState() method call is removed -- this call
1718         triggered any necessary layout, but that's already done through WebPage::updateRendering().
1719
1720         CompositingCoordinator::flushPendingLayerChanges() doesn't rely on the
1721         FrameView flush return value since that's not available anymore -- instead,
1722         true is returned always.
1723
1724         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1725         (WebKit::CompositingCoordinator::flushPendingLayerChanges):
1726         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
1727         (WebKit::LayerTreeHost::layerFlushTimerFired):
1728
1729 2020-05-13  Per Arne Vollan  <pvollan@apple.com>
1730
1731         Unreviewed compile fix after r261584.
1732
1733         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1734
1735 2020-05-13  Tomoki Imai  <Tomoki.Imai@sony.com>
1736
1737         Selected element on Web Inspector is not highlighted with CPU Rendering.
1738         https://bugs.webkit.org/show_bug.cgi?id=195933
1739
1740         Reviewed by Devin Rousso.
1741
1742         Since WebInspectorClient::drawHighlight was not called while non accelerated compositing mode, we cannot see element highlight on web inspector.
1743         This patch adds WebInspectorClient::drawHighlight call in WebPage::drawRect, which draws webpage image while non accelerated compositing mode, to overlay the highlight.
1744         WebInspectorClient::highlight and WebInspectorClient::hideHighlight currently requests re-paint whole web page, but it should be able to optimize by only updating dirty rects in the future.
1745
1746         * WebProcess/Inspector/WebInspectorClient.cpp:
1747         (WebKit::WebInspectorClient::highlight): If it's not acceleratedCompositingEnabled, then just request repaint.
1748         (WebKit::WebInspectorClient::hideHighlight): If it's not acceleratedCompositingEnabled, then just request repaint.
1749         * WebProcess/WebPage/WebPage.cpp:
1750         (WebKit::WebPage::drawRect): Draw inspector overlay here if it's not accelerated compositing mode.
1751
1752 2020-05-13  Carlos Garcia Campos  <cgarcia@igalia.com>
1753
1754         Unreviewed. Fix GTK debug build after r261554
1755
1756         Remove writeToClipboard that receives a const SelectionData& that is no longer used.
1757
1758         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1759         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1760
1761 2020-05-12  Peng Liu  <peng.liu6@apple.com>
1762
1763         Add the feature flag plist file parser
1764         https://bugs.webkit.org/show_bug.cgi?id=211457
1765
1766         Reviewed by Tim Horton.
1767
1768         WebKit needs to parse the feature flags plist by itself in some cases.
1769
1770         * Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm: Added.
1771         (WebKit::featureFlagEnabled):
1772         * Shared/WebPreferencesDefaultValues.cpp:
1773         (WebKit::defaultAsyncFrameAndOverflowScrollingEnabled):
1774         (WebKit::defaultUseGPUProcessForMedia):
1775         (WebKit::defaultRenderCanvasInGPUProcessEnabled):
1776         (WebKit::defaultCaptureAudioInGPUProcessEnabled):
1777         (WebKit::defaultCaptureVideoInGPUProcessEnabled):
1778         (WebKit::defaultWebRTCCodecsInGPUProcess):
1779         (WebKit::defaultWebGL2Enabled):
1780         (WebKit::defaultWebGPUEnabled):
1781         (WebKit::defaultInAppBrowserPrivacy):
1782         (WebKit::defaultIncrementalPDFEnabled):
1783         (WebKit::defaultWebXREnabled):
1784         * Shared/WebPreferencesDefaultValues.h:
1785         * SourcesCocoa.txt:
1786         * WebKit.xcodeproj/project.pbxproj:
1787
1788 2020-05-12  Alex Christensen  <achristensen@webkit.org>
1789
1790         Give some NetworkLoadMetrics to WebCoreNSURLSession's delegate
1791         https://bugs.webkit.org/show_bug.cgi?id=211759
1792         <rdar://problem/62909440>
1793
1794         Reviewed by Jer Noble.
1795
1796         This also reduces duplicate lookups in RemoteMediaResourceManager
1797
1798         * GPUProcess/media/RemoteMediaResource.cpp:
1799         (WebKit::RemoteMediaResource::loadFinished):
1800         * GPUProcess/media/RemoteMediaResource.h:
1801         * GPUProcess/media/RemoteMediaResourceManager.cpp:
1802         (WebKit::RemoteMediaResourceManager::responseReceived):
1803         (WebKit::RemoteMediaResourceManager::redirectReceived):
1804         (WebKit::RemoteMediaResourceManager::dataSent):
1805         (WebKit::RemoteMediaResourceManager::dataReceived):
1806         (WebKit::RemoteMediaResourceManager::accessControlCheckFailed):
1807         (WebKit::RemoteMediaResourceManager::loadFailed):
1808         (WebKit::RemoteMediaResourceManager::loadFinished):
1809         * GPUProcess/media/RemoteMediaResourceManager.h:
1810         * GPUProcess/media/RemoteMediaResourceManager.messages.in:
1811         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1812         (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
1813         * WebProcess/GPU/media/RemoteMediaResourceProxy.cpp:
1814         (WebKit::RemoteMediaResourceProxy::loadFinished):
1815         * WebProcess/GPU/media/RemoteMediaResourceProxy.h:
1816
1817 2020-05-12  Jiewen Tan  <jiewen_tan@apple.com>
1818
1819         [WebAuthn] Don't assume extensions always exist
1820         https://bugs.webkit.org/show_bug.cgi?id=211760
1821         <rdar://problem/61217642>
1822
1823         Reviewed by Brent Fulgham.
1824
1825         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
1826         (WebKit::WebCore::processGoogleLegacyAppIdSupportExtension):
1827         * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:
1828         (WebKit::CtapAuthenticator::processGoogleLegacyAppIdSupportExtension):
1829
1830 2020-05-12  Chris Dumez  <cdumez@apple.com>
1831
1832         [WK2] Neuter WKFrameIsFrameSet() / WKPageGetFrameSetLargestFrame() C API
1833         https://bugs.webkit.org/show_bug.cgi?id=211808
1834
1835         Reviewed by Darin Adler.
1836
1837         Neuter WKFrameIsFrameSet() / WKPageGetFrameSetLargestFrame() C API. This is only SPI and is only used for slightly
1838         different printing behavior in Safari. Framesets are no longer supported in HTML5 and are now super rare. Support
1839         for this C API adds quite a bit of code complexity and crashes such as <rdar://problem/60322282>, it just does not
1840         seem worth it anymore.
1841
1842         * UIProcess/API/C/WKFrame.cpp:
1843         (WKFrameIsFrameSet):
1844         * UIProcess/API/C/WKPage.cpp:
1845         (WKPageGetFrameSetLargestFrame):
1846         * UIProcess/WebFrameProxy.cpp:
1847         (WebKit::WebFrameProxy::didCommitLoad):
1848         * UIProcess/WebFrameProxy.h:
1849         (WebKit::WebFrameProxy::setIsFrameSet): Deleted.
1850         (WebKit::WebFrameProxy::isFrameSet const): Deleted.
1851         * UIProcess/WebPageProxy.cpp:
1852         (WebKit::WebPageProxy::resetState):
1853         (WebKit::WebPageProxy::frameDidBecomeFrameSet): Deleted.
1854         (WebKit::WebPageProxy::frameSetLargestFrameChanged): Deleted.
1855         * UIProcess/WebPageProxy.h:
1856         (WebKit::WebPageProxy::focusedFrame const):
1857         (WebKit::WebPageProxy::frameSetLargestFrame const): Deleted.
1858         * UIProcess/WebPageProxy.messages.in:
1859         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1860         (WebKit::WebChromeClient::contentsSizeChanged const):
1861         (WebKit::findLargestFrameInFrameSet): Deleted.
1862         * WebProcess/WebCoreSupport/WebChromeClient.h:
1863         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1864         (WebKit::WebFrameLoaderClient::dispatchDidBecomeFrameset): Deleted.
1865         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1866
1867 2020-05-12  Per Arne Vollan  <pvollan@apple.com>
1868
1869         [iOS] Rebuild MobileGestalt cache if needed
1870         https://bugs.webkit.org/show_bug.cgi?id=211739
1871
1872         Reviewed by Darin Adler.
1873
1874         This patch was written by Geoff Garen and myself. Rebuild the MobileGestalt cache in the UI process if the
1875         MobileGestalt cache is stale. This should be done before starting a new WebContent process. If the cache
1876         is not rebuilt, every MobileGestalt query in the WebContent process will fail, since access to the daemon
1877         is denied.
1878
1879         No new tests, since testing this is not trivial. It would involve deleting the MobileGestalt cache and
1880         making sure it is rebuilt afterwards. This could be an API test, but API tests are not supported on iOS
1881         devices.
1882
1883         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1884         (WebKit::WebProcessPool::platformInitializeWebProcess):
1885
1886 2020-05-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1887
1888         [GTK] Rework drag and drop handling in preparation for GTK4
1889         https://bugs.webkit.org/show_bug.cgi?id=211723
1890
1891         Reviewed by Adrian Perez de Castro.
1892
1893         Split DragAndDropHelper class into DragSource and DropTarget classes. This separates the source and destination
1894         parts making it easier to follow. This patch also adds PageClient::didPerformDragControllerAction() to notify
1895         back the view when an operation is done to update the result.
1896
1897         * SourcesGTK.txt:
1898         * UIProcess/API/gtk/DragSource.h: Added.
1899         * UIProcess/API/gtk/DragSourceGtk3.cpp: Added.
1900         (WebKit::DragSource::DragSource):
1901         (WebKit::DragSource::~DragSource):
1902         (WebKit::DragSource::begin):
1903         * UIProcess/API/gtk/DropTarget.h: Added.
1904         * UIProcess/API/gtk/DropTargetGtk3.cpp: Added.
1905         (WebKit::DropTarget::DropTarget):
1906         (WebKit::DropTarget::~DropTarget):
1907         (WebKit::DropTarget::accept):
1908         (WebKit::DropTarget::enter):
1909         (WebKit::DropTarget::update):
1910         (WebKit::DropTarget::dataReceived):
1911         (WebKit::DropTarget::didPerformAction):
1912         (WebKit::DropTarget::leaveTimerFired):
1913         (WebKit::DropTarget::leave):
1914         (WebKit::DropTarget::drop):
1915         * UIProcess/API/gtk/PageClientImpl.cpp:
1916         (WebKit::PageClientImpl::startDrag):
1917         (WebKit::PageClientImpl::didPerformDragControllerAction):
1918         * UIProcess/API/gtk/PageClientImpl.h:
1919         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1920         (webkitWebViewBaseConstructed):
1921         (webkit_web_view_base_class_init):
1922         (webkitWebViewBaseStartDrag):
1923         (webkitWebViewBaseDidPerformDragControllerAction):
1924         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
1925         * UIProcess/PageClient.h:
1926         (WebKit::PageClient::didPerformDragControllerAction):
1927         * UIProcess/WebPageProxy.cpp:
1928         (WebKit::WebPageProxy::didPerformDragControllerAction):
1929         * UIProcess/gtk/DragAndDropHandler.cpp: Removed.
1930         * WebProcess/WebPage/WebPage.cpp:
1931         (WebKit::WebPage::performDragControllerAction):
1932         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
1933
1934 2020-05-12  Jacob Uphoff  <jacob_uphoff@apple.com>
1935
1936         Unreviewed, reverting r261557.
1937
1938         This commit caused testing to exit early due to too many
1939         crashes on macOS Catalina Asan
1940
1941         Reverted changeset:
1942
1943         "Allow WebAudioBufferList to dynamically change its number of
1944         frames"
1945         https://bugs.webkit.org/show_bug.cgi?id=211720
1946         https://trac.webkit.org/changeset/261557
1947
1948 2020-05-12  Per Arne Vollan  <pvollan@apple.com>
1949
1950         Unreviewed crash fix.
1951
1952         Use correct global name for icon service in RELEASE_ASSERT.
1953
1954         * WebProcess/WebPage/WebPage.cpp:
1955         (WebKit::WebPage::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
1956
1957 2020-05-12  Youenn Fablet  <youenn@apple.com>
1958
1959         Allow WebAudioBufferList to dynamically change its number of frames
1960         https://bugs.webkit.org/show_bug.cgi?id=211720
1961
1962         Reviewed by Eric Carlson.
1963
1964         * WebProcess/cocoa/RemoteCaptureSampleManager.cpp:
1965         (WebKit::RemoteCaptureSampleManager::RemoteAudio::setStorage):
1966         (WebKit::RemoteCaptureSampleManager::RemoteAudio::audioSamplesAvailable):
1967         * WebProcess/cocoa/RemoteCaptureSampleManager.h:
1968
1969 2020-05-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1970
1971         [GTK4] Add support for clipboard operations
1972         https://bugs.webkit.org/show_bug.cgi?id=211561
1973
1974         Reviewed by Adrian Perez de Castro.
1975
1976         * UIProcess/gtk/Clipboard.h:
1977         * UIProcess/gtk/ClipboardGtk4.cpp:
1978         (WebKit::Clipboard::Clipboard):
1979         (WebKit::Clipboard::type const):
1980         (WebKit::Clipboard::formats):
1981         (WebKit::ReadTextAsyncData::ReadTextAsyncData):
1982         (WebKit::Clipboard::readText):
1983         (WebKit::ReadFilePathsAsyncData::ReadFilePathsAsyncData):
1984         (WebKit::Clipboard::readFilePaths):
1985         (WebKit::ReadBufferAsyncData::ReadBufferAsyncData):
1986         (WebKit::Clipboard::readBuffer):
1987         (WebKit::Clipboard::write):
1988         (WebKit::Clipboard::clear):
1989
1990 2020-05-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1991
1992         [GTK] Rework clipboard handling in preparation for GTK4
1993         https://bugs.webkit.org/show_bug.cgi?id=211511
1994
1995         Reviewed by Adrian Perez de Castro.
1996
1997         Use async APIs to avoid blocking the UI process during the communication with the clipboard. In GTK4 only async
1998         APIs are available. Add Clipboard class to handle the communication with the clipboard with the GTK
1999         implementation in ClipboardGtk3 and ClipboardGtk4 files.
2000
2001         * Shared/gtk/WebSelectionData.cpp:
2002         (WebKit::WebSelectionData::WebSelectionData): Add constructor receivnig an rvalue reference.
2003         * Shared/gtk/WebSelectionData.h:
2004         * SourcesGTK.txt:
2005         * UIProcess/WebPasteboardProxy.h:
2006         * UIProcess/WebPasteboardProxy.messages.in:
2007         * UIProcess/gtk/Clipboard.cpp: Added.
2008         (WebKit::clipboard):
2009         (WebKit::primary):
2010         (WebKit::Clipboard::get):
2011         * UIProcess/gtk/Clipboard.h: Added.
2012         * UIProcess/gtk/ClipboardGtk3.cpp: Added.
2013         (WebKit::Clipboard::Clipboard):
2014         (WebKit::isPrimaryClipboard):
2015         (WebKit::Clipboard::type const):
2016         (WebKit::FormatsAsyncData::FormatsAsyncData):
2017         (WebKit::Clipboard::formats):
2018         (WebKit::ReadTextAsyncData::ReadTextAsyncData):
2019         (WebKit::Clipboard::readText):
2020         (WebKit::ReadFilePathsAsyncData::ReadFilePathsAsyncData):
2021         (WebKit::Clipboard::readFilePaths):
2022         (WebKit::ReadBufferAsyncData::ReadBufferAsyncData):
2023         (WebKit::Clipboard::readBuffer):
2024         (WebKit::Clipboard::write):
2025         (WebKit::Clipboard::clear):
2026         * UIProcess/gtk/ClipboardGtk4.cpp: Added.
2027         (WebKit::Clipboard::Clipboard):
2028         (WebKit::Clipboard::type const):
2029         (WebKit::Clipboard::formats):
2030         (WebKit::Clipboard::readText):
2031         (WebKit::Clipboard::readFilePaths):
2032         (WebKit::Clipboard::readBuffer):
2033         (WebKit::Clipboard::write):
2034         (WebKit::Clipboard::clear):
2035         * UIProcess/gtk/WebPasteboardProxyGtk.cpp:
2036         (WebKit::WebPasteboardProxy::getTypes):
2037         (WebKit::WebPasteboardProxy::readText):
2038         (WebKit::WebPasteboardProxy::readFilePaths):
2039         (WebKit::WebPasteboardProxy::readBuffer):
2040         (WebKit::WebPasteboardProxy::writeToClipboard):
2041         (WebKit::WebPasteboardProxy::clearClipboard):
2042         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2043         (WebKit::WebPlatformStrategies::types):
2044         (WebKit::WebPlatformStrategies::readTextFromClipboard):
2045         (WebKit::WebPlatformStrategies::readFilePathsFromClipboard):
2046         (WebKit::WebPlatformStrategies::readBufferFromClipboard):
2047         (WebKit::WebPlatformStrategies::writeToClipboard):
2048         (WebKit::WebPlatformStrategies::clearClipboard):
2049         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2050
2051 2020-05-12  Youenn Fablet  <youenn@apple.com>
2052
2053         Introduce a RealtimeMediaSource video sample observer
2054         https://bugs.webkit.org/show_bug.cgi?id=211718
2055
2056         Reviewed by Eric Carlson.
2057
2058         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
2059         (WebKit::UserMediaCaptureManagerProxy::SourceProxy::SourceProxy):
2060         (WebKit::UserMediaCaptureManagerProxy::SourceProxy::~SourceProxy):
2061         * WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp:
2062         (WebKit::MediaRecorderPrivate::MediaRecorderPrivate):
2063         (WebKit::MediaRecorderPrivate::~MediaRecorderPrivate):
2064         (WebKit::MediaRecorderPrivate::videoSampleAvailable):
2065         (WebKit::MediaRecorderPrivate::stopRecording):
2066         (WebKit::MediaRecorderPrivate::sampleBufferUpdated): Deleted.
2067         * WebProcess/GPU/webrtc/MediaRecorderPrivate.h:
2068
2069 2020-05-12  Mark Lam  <mark.lam@apple.com>
2070
2071         Wasm::enableFastMemory() was called too late.
2072         https://bugs.webkit.org/show_bug.cgi?id=211773
2073
2074         Reviewed by Yusuke Suzuki.
2075
2076         Previously, we were calling Wasm::enableFastMemory() in WebProcess::initializeWebProcess().
2077         By then, it is too late because the JSC::Config and WTF::Config have already been
2078         frozen.  There is nothing special about Wasm::enableFastMemory() that it needs to
2079         be called this late.  This patch moves it into JSC::initializeThreading() where
2080         it belongs.
2081
2082         This change also make the initialization of Wasm fast memory consistent with how
2083         we have always done it for the jsc shell i.e. it is initialized at the end of
2084         JSC::initializeThreading().
2085
2086         * WebProcess/WebProcess.cpp:
2087         (WebKit::WebProcess::initializeWebProcess):
2088
2089 2020-05-11  Darin Adler  <darin@apple.com>
2090
2091         Fix problems caught by replacing WTF::Optional with std::optional
2092         https://bugs.webkit.org/show_bug.cgi?id=211703
2093
2094         Reviewed by Chris Dumez.
2095
2096         * WebProcess/WebPage/ios/WebPageIOS.mm:
2097         (WebKit::plainTextForContext): Clarified ambiguous overload resolution by writing
2098         the conversion from a live range to a SimpleRange out explicitly. Also fixed a typo
2099         where there was a missing "&" in a "const&" argument.
2100
2101 2020-05-11  Simon Fraser  <simon.fraser@apple.com>
2102
2103         [ macOS ] scrollingcoordinator/mac/latching/scrolling-select-should-not-latch-mainframe.html is a flaky failure
2104         https://bugs.webkit.org/show_bug.cgi?id=211747
2105
2106         Reviewed by Tim Horton.
2107
2108         Add an option to monitorWheelEvents to reset latching.
2109
2110         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2111         (WKBundlePageStartMonitoringScrollOperations):
2112         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
2113
2114 2020-05-11  Kate Cheney  <katherine_cheney@apple.com>
2115
2116         Fail navigations to non app-bound domains after use of app-bound APIs
2117         https://bugs.webkit.org/show_bug.cgi?id=211647
2118         <rdar://problem/62978159>
2119
2120         Reviewed by Brent Fulgham.
2121
2122         A lot of this patch is deleting the unnecessary variable/function
2123         hasNavigatedAwayFromAppBoundDomain now that navigating away from an
2124         app-bound domain is not possible.
2125         
2126         To address the bug, this sets the default isNavigatingToAppBoundDomain
2127         value to be WTF::nullopt. This will allow app-bound behaviors until
2128         a navigation has been attempted, in which case it will fail or will
2129         update isNavigatingToAppBoundDomain to the correct value.
2130
2131
2132         * Shared/LoadParameters.cpp:
2133         (WebKit::LoadParameters::encode const):
2134         (WebKit::LoadParameters::decode):
2135         * Shared/LoadParameters.h:
2136         * Shared/PolicyDecision.h:
2137         (WebKit::PolicyDecision::encode const):
2138         (WebKit::PolicyDecision::decode):
2139         * UIProcess/ProvisionalPageProxy.cpp:
2140         (WebKit::ProvisionalPageProxy::loadData):
2141         (WebKit::ProvisionalPageProxy::loadRequest):
2142         (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionSync):
2143         * UIProcess/ProvisionalPageProxy.h:
2144         * UIProcess/WebPageProxy.cpp:
2145         (WebKit::WebPageProxy::loadRequest):
2146         (WebKit::WebPageProxy::loadRequestWithNavigationShared):
2147         (WebKit::WebPageProxy::loadData):
2148         (WebKit::WebPageProxy::loadDataWithNavigationShared):
2149         (WebKit::WebPageProxy::receivedPolicyDecision):
2150         (WebKit::WebPageProxy::continueNavigationInNewProcess):
2151         (WebKit::WebPageProxy::decidePolicyForNavigationActionSyncShared):
2152         (WebKit::WebPageProxy::hasNavigatedAwayFromAppBoundDomain const): Deleted.
2153         Remove hasNavigatedAwayFromAppBoundDomain.
2154
2155         (WebKit::WebPageProxy::setIsNavigatingToAppBoundDomainAndCheckIfPermitted):
2156         Check for new m_hasExecutedAppBoundBehaviorBeforeNavigation parameter
2157         and fail the navigation if a WebView has used app-bound behavior then
2158         tries to navigate to a non app-bound domain.
2159
2160         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2161         Update error message to be more general now that more than one error
2162         can occur.
2163
2164         * UIProcess/WebPageProxy.h:
2165         (WebKit::WebPageProxy::setHasExecutedAppBoundBehaviorBeforeNavigation):
2166         * UIProcess/WebPageProxy.messages.in:
2167         New parameter to indicate a WebView has used app-bound APIs before
2168         navigating.
2169
2170         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2171         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
2172         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2173         (WebKit::WebFrameLoaderClient::shouldEnableInAppBrowserPrivacyProtections):
2174         (WebKit::WebFrameLoaderClient::hasNavigatedAwayFromAppBoundDomain): Deleted.
2175         (WebKit::WebFrameLoaderClient::needsInAppBrowserPrivacyQuirks const): Deleted.
2176         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2177         Combined two functions into a simpler function:
2178         shouldEnableInAppBrowserPrivacyProtections().
2179
2180         * WebProcess/WebPage/WebPage.cpp:
2181         (WebKit::m_limitsNavigationsToAppBoundDomains):
2182         (WebKit::WebPage::updatePreferences):
2183         Store the special app-bound domain flag to gate the service worker
2184         API. This should be stored separately from
2185         m_isNavigatingToAppBoundDomain, because in the WebPage constructor we
2186         don't yet know whether the WKAppBoundDomains key exists.
2187
2188         (WebKit::WebPage::loadRequest):
2189         (WebKit::WebPage::loadDataImpl):
2190         (WebKit::WebPage::loadData):
2191         (WebKit::WebPage::loadAlternateHTML):
2192         (WebKit::WebPage::didReceivePolicyDecision):
2193         Remove hasNavigatedAwayFromAppBoundDomain.
2194
2195         (WebKit::WebPage::runJavaScript):
2196         (WebKit::WebPage::setIsNavigatingToAppBoundDomain):
2197         (WebKit::WebPage::shouldEnableInAppBrowserPrivacyProtections):
2198         If m_needsInAppBrowserPrivacyQuirks are on for testing, don't enable
2199         protections. Only notify the WebPageProxy of app-bound behavior if
2200         a navigation has not occured and we know the webView is not app-bound
2201         (in order to limit IPC).
2202
2203         (WebKit::m_isNavigatingToAppBoundDomain): Deleted.
2204         * WebProcess/WebPage/WebPage.h:
2205         (WebKit::WebPage::isNavigatingToAppBoundDomain const):
2206         (WebKit::WebPage::setIsNavigatingToAppBoundDomain): Deleted.
2207         (WebKit::WebPage::hasNavigatedAwayFromAppBoundDomain const): Deleted.
2208         (WebKit::WebPage::setHasNavigatedAwayFromAppBoundDomain): Deleted.
2209         (WebKit::WebPage::needsInAppBrowserPrivacyQuirks const): Deleted.
2210
2211 2020-05-11  Wenson Hsieh  <wenson_hsieh@apple.com>
2212
2213         Remove some unnecessary indirection when getting Document’s Editor
2214         https://bugs.webkit.org/show_bug.cgi?id=211744
2215
2216         Reviewed by Geoffrey Garen.
2217
2218         See WebCore ChangeLog for more information. No change in behavior.
2219
2220         * WebProcess/WebPage/ios/WebPageIOS.mm:
2221         (WebKit::WebPage::performActionOnElement):
2222
2223 2020-05-11  Simon Fraser  <simon.fraser@apple.com>
2224
2225         Fix possible crash in ViewGestureController on macOS
2226         https://bugs.webkit.org/show_bug.cgi?id=211745
2227
2228         Reviewed by Tim Horton.
2229
2230         When ViewGestureController::resetState() clears m_swipeCancellationTracker, it should set it to canceled so that
2231         any pending -trackSwipeEventWithOptions:... which is holding a reference to the WKSwipeCancellationTracker knows
2232         to stop.
2233
2234         * UIProcess/mac/ViewGestureControllerMac.mm:
2235         (WebKit::ViewGestureController::resetState):
2236         (WebKit::ViewGestureController::reset):
2237
2238 2020-05-11  Peng Liu  <peng.liu6@apple.com>
2239
2240         Enable the mock video presentation mode in related layout tests and fix test failures
2241         https://bugs.webkit.org/show_bug.cgi?id=211645
2242
2243         Reviewed by Darin Adler.
2244
2245         Fix the mistake in VideoFullscreenManager::supportsVideoFullscreen() introduced in r202274.
2246
2247         * WebProcess/cocoa/VideoFullscreenManager.mm:
2248         (WebKit::VideoFullscreenManager::supportsVideoFullscreen const):
2249
2250 2020-05-11  Per Arne Vollan  <pvollan@apple.com>
2251
2252         [iOS] Update message filtering rules in the WebContent process' sandbox
2253         https://bugs.webkit.org/show_bug.cgi?id=211188
2254         <rdar://problem/60922910>
2255
2256         Reviewed by Brent Fulgham.
2257
2258         Based on telemetry and local testing, update the message filtering rules in the WebContent process' sandbox on iOS.
2259         Messages that have not been observed being in use, should be denied.
2260
2261         No new tests, covered by existing tests.
2262
2263         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2264
2265 2020-05-11  Chris Dumez  <cdumez@apple.com>
2266
2267         [iOS] WKWebView.evaluateJavaScript should run at foreground priority when app is foreground
2268         https://bugs.webkit.org/show_bug.cgi?id=211734
2269
2270         Reviewed by Darin Adler.
2271
2272         * UIProcess/WebPageProxy.cpp:
2273         (WebKit::WebPageProxy::runJavaScriptInFrameInScriptWorld):
2274
2275 2020-05-11  Wenson Hsieh  <wenson_hsieh@apple.com>
2276
2277         REGRESSION (r253267): issues on touchstart/touchend/touchmove (pointerdown/pointerup/pointermove) events
2278         https://bugs.webkit.org/show_bug.cgi?id=211521
2279         <rdar://problem/62942374>
2280
2281         Reviewed by Darin Adler.
2282
2283         As a brief refresher, deferring gesture recognizers allow us to handle otherwise blocking touch events
2284         asynchronously by having all preventable native gesture recognizers require the deferring gesture recognizer to
2285         fail; we only fail the deferring gesture recognizer once the web process has handled the touch event, and did
2286         not call `preventDefault()`.
2287
2288         These additional failure requirements can cause preventable gestures to be linked together in the same gesture
2289         dependency subgraph; since each subgraph is reset only once all gestures in the subgraph have failed or ended,
2290         this might cause some gestures to be reset after a delay (rather than being reset immediately). To mitigate
2291         this, we divide the set of preventable gestures into multiple (currently, 2) subgraphs: one for gestures that
2292         are reset after a delay, and another for gestures that are immediately resettable. This way, immediately
2293         resettable gestures are able to reset and recognize again, without having to wait for other slower preventable
2294         gesture recognizers to reset.
2295
2296         When fast-clicking is disabled (e.g. when loading a desktop web page on a mobile form factor, or when the
2297         viewport has been zoomed in), the blocking synthetic double tap gesture recognizer (that is, `WKContentView`'s
2298         `_doubleTapGestureRecognizer`) is enabled, and adds itself as a dynamic failure requirement to the content
2299         view's synthetic single tap gesture recognizer (`_singleTapGestureRecognizer`). In terms of the gesture
2300         dependency graph, this causes the single tap gesture to form an edge with the double tap gesture, which ends up
2301         uniting both deferring gesture recognizers under the same subgraph. This means UIWebTouchEventsGestureRecognizer,
2302         which should be one of the gestures in the immediately resettable subgraph, is now connected to the rest of the
2303         delayed resettable gestures, meaning that it cannot recognize until "slowly resettable" gestures such as the
2304         tap-and-half text selection gesture have also been reset. This delay causes touch events to be dropped, as is
2305         the case in this bug.
2306
2307         To fix this, simply quarantine the single tap and double tap gestures inside their own subgraph by introducing a
2308         separate deferring gesture recognizer for them. When fast-clicking is enabled, this does not hinder the ability
2309         for the single tap gesture to fire in rapid succession, since the double tap gesture is disabled (and thus, not
2310         a part of the graph at all). when fast-clicking is disabled, then the double tap gesture will prevent the single
2311         tap gesture from being immediately reset anyways, due to the direct failure requirement between the double and
2312         single tap gesture.
2313
2314         Doing this ensures that no other immediately resettable gesture (`UIWebTouchEventsGestureRecognizer` included)
2315         is accidentally blocked from immediately resetting due to being linked to the delayed resettable gestures by way
2316         of the synthetic single and double tap gestures.
2317
2318         Test: fast/events/touch/ios/tap-and-half-when-viewport-is-not-responsive.html
2319
2320         * UIProcess/ios/WKContentViewInteraction.h:
2321
2322         Add a dedicated deferring gesture recognizer for the synthetic single tap and double tap gesture recognizers.
2323
2324         * UIProcess/ios/WKContentViewInteraction.mm:
2325         (-[WKContentView setUpInteraction]):
2326         (-[WKContentView cleanUpInteraction]):
2327
2328         Use -_deferringGestureRecognizers instead of hard-coding logic for each deferring gesture.
2329
2330         (-[WKContentView _removeDefaultGestureRecognizers]): Ditto.
2331         (-[WKContentView _addDefaultGestureRecognizers]): Ditto.
2332         (-[WKContentView _deferringGestureRecognizers]):
2333
2334         We now have 3 distinct deferring gestures; instead of handling the three deferring gestures individually in
2335         various places in this file, group them all behind a getter that returns an array of deferring gestures, and use
2336         this instead.
2337
2338         (-[WKContentView _doneDeferringNativeGestures:]): Ditto.
2339         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]): Ditto.
2340         (-[WKContentView deferringGestureRecognizer:shouldDeferOtherGestureRecognizer:]):
2341
2342         Partition the synthetic single tap and double tap gestures into their own subgraph.
2343
2344 2020-05-11  Per Arne Vollan  <pvollan@apple.com>
2345
2346         Unreviewed, reverting r261296.
2347
2348         Rolling r260769 back in, since this was not causing a
2349         regression.
2350
2351         Reverted changeset:
2352
2353         "Unreviewed, reverting r260769."
2354         https://bugs.webkit.org/show_bug.cgi?id=211578
2355         https://trac.webkit.org/changeset/261296
2356
2357 2020-05-11  Wenson Hsieh  <wenson_hsieh@apple.com>
2358
2359         Unreviewed, fix the watchOS build after r261457
2360
2361         Put -[WKActionSheetAssistant suggestedActionsForContextMenuWithPositionInformation:] behind a USE(UICONTEXTMENU)
2362         compiler guard; currently, it is declared everywhere, but only implemented if ENABLE(DATA_DETECTION) &&
2363         USE(UICONTEXTMENU). However, WKContentView only invokes it behind code that is guarded by USE(UICONTEXTMENU).
2364
2365         * UIProcess/ios/WKActionSheetAssistant.h:
2366         * UIProcess/ios/WKActionSheetAssistant.mm:
2367         (-[WKActionSheetAssistant suggestedActionsForContextMenuWithPositionInformation:]):
2368
2369 2020-05-11  Philippe Normand  <pnormand@igalia.com>
2370
2371         [GTK] Media and audio permission request unit tests are timing out
2372         https://bugs.webkit.org/show_bug.cgi?id=158257
2373
2374         Reviewed by Carlos Garcia Campos.
2375
2376         Add new private API to disable secure capture device contexts.
2377         This is needed for the API tests.
2378
2379         * UIProcess/API/glib/WebKitWebView.cpp:
2380         (webkitWebViewSetMediaCaptureRequiresSecureConnection):
2381         * UIProcess/API/glib/WebKitWebViewPrivate.h:
2382
2383 2020-05-10  Basuke Suzuki  <basuke.suzuki@sony.com>
2384
2385         Add ENABLE_PERIODIC_MEMORY_MONITOR flag.
2386         https://bugs.webkit.org/show_bug.cgi?id=211704
2387
2388         Reviewed by Yusuke Suzuki.
2389
2390         No new tests because there's no behavior change.
2391
2392         Replace PLATFORM() macros with ENABLE() macro.
2393
2394         * WebProcess/WebProcess.cpp:
2395         (WebKit::WebProcess::initializeWebProcess):
2396
2397 2020-05-10  Michael Catanzaro  <mcatanzaro@gnome.org>
2398
2399         REGRESSION(r261270): Broke build with python3
2400         https://bugs.webkit.org/show_bug.cgi?id=211699
2401
2402         Reviewed by Yusuke Suzuki.
2403
2404         Remove the problematic print statement. It causes the script to fail. If fixed, it spams the
2405         build output. We only print messages during the build when there are problems to be fixed.
2406
2407         * Scripts/generate-message-receiver.py:
2408         (main):
2409
2410 2020-05-10  Tim Horton  <timothy_horton@apple.com>
2411
2412         Clicking a tel:// link on iPad with a trackpad presents different UI than tapping on it
2413         https://bugs.webkit.org/show_bug.cgi?id=211686
2414         <rdar://problem/57941589>
2415
2416         Reviewed by Wenson Hsieh.
2417
2418         Previously, iOS WebKit had code in handleTap, handleTwoFingerTapAtPoint, and commitPotentialTap,
2419         which introspected the hit element /before/ dispatching the tap (or synthetic click) to the DOM,
2420         short circuiting all normal event handling machinery in order to prevent the default action
2421         and present the Data Detectors UI for the given link.
2422
2423         There's one immediate problem with this, which is that there is no similar code in the direct
2424         click event handler path, which we now use for trackpad/mouse input on iPad. There's also a
2425         secondary problem (which we have not seen in practice), which is that pages cannot preventDefault
2426         to avoid launching the Data Detectors UI on a link, like they could to prevent an ordinary
2427         link from being followed.
2428
2429         In order to resolve both issues and reduce duplication of logic, move the code that introspects
2430         the element and invokes Data Detectors UI from high-level WebKit event dispatch code (where it
2431         doesn't really belong) down to WebCore's default click event handler for anchors, right next to
2432         the code that would ordinarily cause a navigation. This way, no matter how we get here, whether
2433         by synthetic click or real click, we'll invoke the Data Detectors UI.
2434
2435         One alternative considered at length: we could actually let the navigation happen, and instead
2436         handle the switch in navigation policy code, but there are a few reasons that did not seem ideal:
2437         1) We'd need to plumb platform-specific data structures through a ton of FrameLoader code.
2438         2) Clients often block non-HTTP(S) navigations, so in order to keep the feature functional,
2439            we'd have to disregard the client's policy decision, defeating much of the purpose of making
2440            use of the navigation mechanism in the first place.
2441
2442         * UIProcess/PageClient.h:
2443         * UIProcess/WebPageProxy.h:
2444         * UIProcess/WebPageProxy.messages.in:
2445         * UIProcess/ios/PageClientImplIOS.h:
2446         * UIProcess/ios/PageClientImplIOS.mm:
2447         (WebKit::PageClientImpl::showDataDetectorsUIForPositionInformation):
2448         * UIProcess/ios/WebPageProxyIOS.mm:
2449         (WebKit::WebPageProxy::showDataDetectorsUIForPositionInformation):
2450         * WebProcess/WebCoreSupport/WebChromeClient.h:
2451         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
2452         (WebKit::WebChromeClient::showDataDetectorsUIForElement):
2453         Plumb showDataDetectorsUIForPositionInformation from iOS WebKit's ChromeClient
2454         implementation all the way to WKContentView.
2455
2456         * UIProcess/ios/WKActionSheetAssistant.h:
2457         * UIProcess/ios/WKActionSheetAssistant.mm:
2458         (-[WKActionSheetAssistant showDataDetectorsUIForPositionInformation:]):
2459         (-[WKActionSheetAssistant contextMenuInteraction:configurationForMenuAtLocation:]):
2460         (-[WKActionSheetAssistant contextMenuInteraction:previewForHighlightingMenuWithConfiguration:]):
2461         (-[WKActionSheetAssistant showDataDetectorsSheet]): Deleted.
2462         Make it possible to push InteractionInformationAtPosition into WKActionSheetAssistant,
2463         instead of having it always pull a fresh one upon invocation, so that we can use the
2464         position information passed along with the showDataDetectorsUIForPositionInformation message.
2465
2466         (-[WKActionSheetAssistant _contextMenuInteraction:overrideSuggestedActionsForConfiguration:]):
2467         (-[WKActionSheetAssistant suggestedActionsForContextMenuWithPositionInformation:]):
2468         Fix an existing bug where Data Detectors context menus would show extra default actions,
2469         by moving our implementation of the -_contextMenuInteraction:overrideSuggestedActionsForConfiguration:
2470         delegate here, sharing it with WKContentViewInteraction.
2471
2472         In a future patch, we should reconsider having three separate UIContextMenuInteractions.
2473
2474         Also, remove the contextMenuPresentationLocationForActionSheetAssistant: delegate,
2475         since it will be wrong in the case of pushed-in position information, and instead
2476         use the position information's original hit test point.
2477
2478         * UIProcess/ios/WKContentViewInteraction.h:
2479         * UIProcess/ios/WKContentViewInteraction.mm:
2480         (-[WKContentView _showDataDetectorsUI]):
2481         (-[WKContentView _showDataDetectorsUIForPositionInformation:]):
2482         (-[WKContentView _actionForLongPressFromPositionInformation:]):
2483         (-[WKContentView _didNotHandleTapAsClick:]):
2484         (-[WKContentView dataDetectionContextForPositionInformation:]):
2485         (-[WKContentView dataDetectionContextForActionSheetAssistant:positionInformation:]):
2486         (-[WKContentView _showDataDetectorsSheet]): Deleted.
2487         (-[WKContentView currentPositionInformation]): Deleted.
2488         (-[WKContentView dataDetectionContextForActionSheetAssistant:]): Deleted.
2489         Instead of exposing an unnecessary -currentPositionInformation getter on WKActionSheetAssistant,
2490         provide it as an argument to the WKActionSheetAssistantDelegate methods that actually need it.
2491
2492         (-[WKContentView contextMenuPresentationLocationForActionSheetAssistant:]): Deleted.
2493         (-[WKContentView _contextMenuInteraction:overrideSuggestedActionsForConfiguration:]):
2494         Adopt WKActionSheetAssistant's suggestedActions mechanism so we can share code.
2495
2496         * UIProcess/ios/WKPDFView.mm:
2497         (-[WKPDFView _showActionSheetForURL:atLocation:withAnnotationRect:]):
2498         (-[WKPDFView dataDetectionContextForActionSheetAssistant:positionInformation:]):
2499         (-[WKPDFView dataDetectionContextForActionSheetAssistant:]): Deleted.
2500         Adapt to some WKActionSheetAssistantDelegate changes.
2501
2502         * WebProcess/WebPage/WebPage.h:
2503         * WebProcess/WebPage/ios/WebPageIOS.mm:
2504         (WebKit::WebPage::handleTap):
2505         (WebKit::WebPage::handleTwoFingerTapAtPoint):
2506         (WebKit::WebPage::commitPotentialTap):
2507         Remove the aforementioned short-circuiting paths for Data Detectors links.
2508 2020-05-09  David Kilzer  <ddkilzer@apple.com>
2509
2510         Attempt #2 to fix internal iOS build
2511
2512         * UIProcess/ios/WKMouseGestureRecognizer.mm:
2513         - Use ALLOW_DEPRECATED_IMPLEMENTATIONS_{BEGIN,END}.
2514
2515 2020-05-09  David Kilzer  <ddkilzer@apple.com>
2516
2517         Attemp to fix internal iOS build
2518
2519         * Platform/spi/ios/UIKitSPI.h:
2520         - Define @class UIHoverEvent using header if available, else
2521           fall back to local class definition.
2522         - Define methods separately from class definition.
2523         * UIProcess/ios/WKMouseGestureRecognizer.mm:
2524         (-[WKMouseGestureRecognizer setView:]):
2525         - Use new method if it is available.
2526
2527 2020-05-09  Commit Queue  <commit-queue@webkit.org>
2528
2529         Unreviewed, reverting r261389.
2530         https://bugs.webkit.org/show_bug.cgi?id=211678
2531
2532         Introduced page loading regression. (Requested by perarne on
2533         #webkit).
2534
2535         Reverted changeset:
2536
2537         "[iOS] Update message filtering rules in the WebContent
2538         process' sandbox"
2539         https://bugs.webkit.org/show_bug.cgi?id=211188
2540         https://trac.webkit.org/changeset/261389
2541
2542 2020-05-09  David Kilzer  <ddkilzer@apple.com>
2543
2544         Adapt LocalCurrentGraphicsContext for iOS
2545         <https://webkit.org/b/211660>
2546
2547         Reviewed by Darin Adler.
2548
2549         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2550         (WebKit::convertPlatformImageToBitmap):
2551         - Use LocalCurrentGraphicsContext for both iOS and Mac code
2552           paths.
2553
2554         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2555         - Switch from PLATFORM(MAC) and PLATFORM(IOS_FAMIY) to
2556           USE(APPKIT) to separate platform code.
2557         (WebKit::convertDragImageToBitmap):
2558         (WebKit::convertImageToBitmap): Delete.
2559         (WebKit::convertCGImageToBitmap): Delete.
2560         - Combine Mac-specific convertImageToBitmap() and iOS-specific
2561           convertCGImageToBitmap() into a single method using DragImage
2562           type and special-casing one line of code.
2563         (WebKit::WebDragClient::startDrag):
2564         (WebKit::WebDragClient::didConcludeEditDrag):
2565         - Combine iOS and Mac methods into a singe method.
2566
2567 2020-05-09  David Quesada  <david_quesada@apple.com>
2568
2569         Remove HAVE_UI_SCROLL_VIEW_INDICATOR_FLASHING_SPI
2570         https://bugs.webkit.org/show_bug.cgi?id=211662
2571         rdar://problem/63048713
2572
2573         Reviewed by Darin Adler.
2574
2575         Remove this platform conditional and unconditionally use -[UIScrolView _flashScrollIndicatorsForAxes:
2576         persistingPreviousFlashes:]. All supported platforms with UIScrollView have this SPI, and the conditional
2577         was excluding Mac Catalyst, making WKKeyboardScrollViewAnimator send a message to its scroll view that
2578         is no longer implemented.
2579
2580         * Platform/spi/ios/UIKitSPI.h:
2581             Remove the declaration of the now unused -_flashScrollIndicatorsPersistingPreviousFlashes:.
2582         * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
2583         (axesForDelta):
2584         (-[WKKeyboardScrollViewAnimator scrollToContentOffset:animated:]):
2585
2586 2020-05-08  David Kilzer  <ddkilzer@apple.com>
2587
2588         Remove empty directories from from svn.webkit.org repository
2589         <https://webkit.org/b/211644>
2590
2591         Reviewed by Darin Adler.
2592
2593         * UIProcess/API/win: Removed.
2594
2595 2020-05-08  Chris Dumez  <cdumez@apple.com>
2596
2597         Regression(r210945): No attachment when sharing to mail
2598         https://bugs.webkit.org/show_bug.cgi?id=211651
2599         <rdar://problem/63040170>
2600
2601         Reviewed by Tim Horton.
2602
2603         When failing to determine foreground state, the code before r210945 was assuming
2604         'foreground', while the code in r210945 assume 'background'. This causes things
2605         to not render properly when we fail to determine the foreground state.
2606
2607         This patch merely restores pre-r210945 behavior. I will investigate why we are
2608         unable to determinate the host application PID for the MailCompositionService.
2609
2610         * UIProcess/ApplicationStateTracker.mm:
2611         (WebKit::isApplicationForeground):
2612
2613 2020-05-08  Nikos Mouchtaris  <nmouchtaris@apple.com>
2614
2615         Implement web-share v2 for files
2616         https://bugs.webkit.org/show_bug.cgi?id=209265
2617
2618         Reviewed by Andy Estes.
2619
2620         Added support for passing file objects over IPC and
2621         sharing of files to share sheet.
2622
2623         * Shared/WebCoreArgumentCoders.cpp:
2624         (IPC::ArgumentCoder<Vector<RawFile>>::encode):
2625         (IPC::ArgumentCoder<Vector<RawFile>>::decode):
2626         (IPC::ArgumentCoder<ShareDataWithParsedURL>::encode):
2627         (IPC::ArgumentCoder<ShareDataWithParsedURL>::decode):
2628         * Shared/WebCoreArgumentCoders.h:
2629         * UIProcess/Cocoa/ShareableFileWrite.h: Added.
2630         * UIProcess/Cocoa/ShareableFileWrite.mm: Added.
2631         (+[WKShareableFileWrite getSharingDirectoryPath]):
2632         (+[WKShareableFileWrite getFileDirectoryForSharing]):
2633         (+[WKShareableFileWrite removeFileDirectoryForSharing]):
2634         (+[WKShareableFileWrite setQuarantineInformationForFilePath:]):
2635         (+[WKShareableFileWrite applyQuarantineSandboxAndDownloadFlagsToFileAtPath:]):
2636         (+[WKShareableFileWrite createFilename:]):
2637         (+[WKShareableFileWrite writeFileToShareableURL:data:]):
2638         * UIProcess/Cocoa/WKShareSheet.mm:
2639         (-[WKShareSheet presentWithParameters:inRect:completionHandler:]):
2640         (-[WKShareSheet _didCompleteWithSuccess:]):
2641         * WebKit.xcodeproj/project.pbxproj:
2642
2643 2020-05-08  Brent Fulgham  <bfulgham@apple.com>
2644
2645         Revise sandbox to stop logging some commonly-used properties 
2646         https://bugs.webkit.org/show_bug.cgi?id=211636
2647         <rdar://problem/63014244>
2648
2649         Reviewed by Per Arne Vollan.
2650
2651         Further living on and testing has shown a handful of sysctl entries that are in regular use, and do not need
2652         to be logged or considered for removal. This patch has no change in behavior, just reduces logging.
2653
2654         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
2655         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
2656
2657 2020-05-08  Chris Dumez  <cdumez@apple.com>
2658
2659         Make WKWebViewConfiguration._alwaysRunsAtForegroundPriority an alias for _clientNavigationsRunAtForegroundPriority
2660         https://bugs.webkit.org/show_bug.cgi?id=211632
2661
2662         Reviewed by Darin Adler.
2663
2664         Make WKWebViewConfiguration._alwaysRunsAtForegroundPriority an alias for _clientNavigationsRunAtForegroundPriority.
2665         _alwaysRunsAtForegroundPriority is a frequent source of process assertion leaks that get blamed on WebKit. Clients
2666         are using this in order to be able to do loads in background views so _clientNavigationsRunAtForegroundPriority
2667         should suffice and is not leak prone since the process assertion is released after the navigation has completed.
2668
2669         * UIProcess/API/APIPageConfiguration.cpp:
2670         (API::PageConfiguration::copy const):
2671         * UIProcess/API/APIPageConfiguration.h:
2672         (API::PageConfiguration::alwaysRunsAtForegroundPriority const): Deleted.
2673         (API::PageConfiguration::setAlwaysRunsAtForegroundPriority): Deleted.
2674         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2675         (-[WKWebViewConfiguration _alwaysRunsAtForegroundPriority]):
2676         (-[WKWebViewConfiguration _setAlwaysRunsAtForegroundPriority:]):
2677         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2678         * UIProcess/WebPageProxy.cpp:
2679         (WebKit::WebPageProxy::close):
2680         (WebKit::WebPageProxy::updateThrottleState):
2681         (WebKit::WebPageProxy::resetStateAfterProcessExited):
2682         * UIProcess/WebPageProxy.h:
2683
2684 2020-05-08  Alex Christensen  <achristensen@webkit.org>
2685
2686         Revert r260390
2687         https://bugs.webkit.org/show_bug.cgi?id=210759
2688         <rdar://problem/62608140>
2689
2690         r260390 was intended to stop hitting some assertions in ~PendingFrameLoad, but it seems to have caused a regression.
2691         Reverting it and removing the invalid assertions.
2692
2693         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2694         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::~PendingFrameLoad):
2695         (WebKit::NetworkCache::SpeculativeLoadManager::~SpeculativeLoadManager):
2696
2697 2020-05-08  Wenson Hsieh  <wenson_hsieh@apple.com>
2698
2699         [iOS] caret appears in the middle of a search field when field is focused on agoda.com
2700         https://bugs.webkit.org/show_bug.cgi?id=211591
2701         <rdar://problem/60605873>
2702
2703         Reviewed by Antoine Quint.
2704
2705         The main search field on the mobile version of this website begins offscreen, with a CSS transform that moves it
2706         to the far right; tapping the button element that (visually) has a search-field-like appearance on the front
2707         page programmatically focuses the real offscreen search field, and animates it onscreen by changing the CSS
2708         transform attribute to remove the x-axis translation.
2709
2710         On iOS, the caret rect is computed and sent to the UI process via editor state updates; however, the editor
2711         state is computed immediately after focusing the input field. As such, the caret rect at this moment is computed
2712         in the middle of the animation, leaving it stuck in an unpredictable location.
2713
2714         To fix this, add plumbing to call into the WebKit client layer when an animation has ended. On iOS, if the
2715         selection is visible (i.e. a ranged selection, or editable caret), then check to see whether the element that
2716         has finished animating contains either endpoint of the selection. If so, then schedule a followup editor state
2717         update to push updated selection information to the UI process.
2718
2719         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2720         (WebKit::WebChromeClient::animationDidFinishForElement):
2721         * WebProcess/WebCoreSupport/WebChromeClient.h:
2722
2723         Add a new client hook for when animations end.
2724
2725         * WebProcess/WebPage/WebPage.cpp:
2726         (WebKit::WebPage::animationDidFinishForElement):
2727         * WebProcess/WebPage/WebPage.h:
2728         * WebProcess/WebPage/ios/WebPageIOS.mm:
2729
2730         Add logic to schedule a new editor state update if needed, after an animation ends that might affect either
2731         the start or end of the selection.
2732
2733         (WebKit::WebPage::animationDidFinishForElement):
2734
2735 2020-05-08  David Kilzer  <ddkilzer@apple.com>
2736
2737         REGRESSION (r260228): Linker warning about limitsNavigationsToAppBoundDomains property overriding instance methods from class
2738         <https://webkit.org/b/211393>
2739
2740         Reviewed by Brent Fulgham.
2741
2742         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2743         (-[WKWebViewConfiguration limitsNavigationsToAppBoundDomains]):
2744         (-[WKWebViewConfiguration setLimitsNavigationsToAppBoundDomains:]):
2745         - Move from WKPrivate category to main category to fix linker
2746           warnings.
2747
2748 2020-05-08  Chris Dumez  <cdumez@apple.com>
2749
2750         REGRESSION(r259209) Webview's pending URL is null after restoring session state
2751         https://bugs.webkit.org/show_bug.cgi?id=211626
2752         <rdar://problem/62992262>
2753
2754         Reviewed by Alex Christensen.
2755
2756         The issue was that WebPageProxy::goToBackForwardItem() would behave differently whether
2757         the page has a running process or not. In particular, when the page did not have a
2758         running process, goToBackForwardItem() would return early and call launchProcessWithItem()
2759         instead. Unlike goToBackForwardItem(), launchProcessWithItem() would fail to set the
2760         pending API request.
2761
2762         To address the issue, I am getting rid of launchProcessWithItem() and merging its logic
2763         into goToBackForwardItem() instead. Both methods shared a lot of code anyway and having
2764         2 separate code paths that may diverge is error prone.
2765
2766         Change is covered by new API test.
2767
2768         * UIProcess/WebPageProxy.cpp:
2769         (WebKit::WebPageProxy::goToBackForwardItem):
2770         (WebKit::WebPageProxy::launchProcessWithItem): Deleted.
2771         * UIProcess/WebPageProxy.h:
2772
2773 2020-05-08  Alex Christensen  <achristensen@webkit.org>
2774
2775         WKWebView.title should be safe browsing warning's title during a safe browsing warning
2776         https://bugs.webkit.org/show_bug.cgi?id=211403
2777
2778         Reviewed by Tim Horton.
2779
2780         Add a new property to PageLoadState, which allows the title to be set underneath it.
2781         That way, once the safe browsing warning is closed, we can update the title to what it would've been,
2782         including any changes that happened while the warning was open.
2783
2784         Covered by an API test.  I also manually verified this fixes rdar://problem/56201982
2785
2786         * UIProcess/PageLoadState.cpp:
2787         (WebKit::PageLoadState::commitChanges):
2788         (WebKit::PageLoadState::reset):
2789         (WebKit::PageLoadState::didCommitLoad):
2790         (WebKit::PageLoadState::title const):
2791         (WebKit::PageLoadState::setTitleFromSafeBrowsingWarning):
2792         * UIProcess/PageLoadState.h:
2793         * UIProcess/WebPageProxy.cpp:
2794         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2795
2796 2020-05-08  Per Arne Vollan  <pvollan@apple.com>
2797
2798         [iOS] Update message filtering rules in the WebContent process' sandbox
2799         https://bugs.webkit.org/show_bug.cgi?id=211188
2800
2801         Reviewed by Brent Fulgham.
2802
2803         Based on telemetry and local testing, update the message filtering rules in the WebContent process' sandbox on iOS.
2804         Messages that have not been observed being in use should be denied.
2805
2806         No new tests, covered by existing tests.
2807
2808         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2809
2810 2020-05-08  Chris Dumez  <cdumez@apple.com>
2811
2812         Turn processDidBecomeUnresponsive logging into error logging
2813         https://bugs.webkit.org/show_bug.cgi?id=211629
2814
2815         Reviewed by Youenn Fablet.
2816
2817         * UIProcess/WebPageProxy.cpp:
2818         (WebKit::WebPageProxy::processDidBecomeUnresponsive):
2819
2820 2020-05-08  Per Arne Vollan  <pvollan@apple.com>
2821
2822         [Cocoa] Close connections to Launch Services after revoking extension
2823         https://bugs.webkit.org/show_bug.cgi?id=211594
2824
2825         Reviewed by Brent Fulgham.
2826
2827         In <https://trac.webkit.org/changeset/258915/webkit>, connections to the Launch Services database mapping
2828         services were denied, by creating a temporary extension. After revoking this extension in the WebContent
2829         process, it is important to close any open connections to Launch Services initiated by the mapping.
2830
2831         No new tests, covered by existing UTI/MIME type tests.
2832
2833         * WebProcess/cocoa/WebProcessCocoa.mm:
2834         (WebKit::WebProcess::platformInitializeWebProcess):
2835
2836 2020-05-08  Youenn Fablet  <youenn@apple.com>
2837
2838         Handle remote audio capture IPC messages in a background thread
2839         https://bugs.webkit.org/show_bug.cgi?id=211583
2840
2841         Reviewed by Eric Carlson.
2842
2843         We introduce RemoteCaptureSampleManager which is responsible to get remote capture sample IPC messages and treat them from a background thread.
2844         It is currently used to handle audio capture IPC messages.
2845         We move UserMediaCaptureManager::Source in its own file and rename it to RemoteRealtimeMediaSource.
2846
2847         Covered by existing tests.
2848
2849         * DerivedSources-input.xcfilelist:
2850         * DerivedSources-output.xcfilelist:
2851         * DerivedSources.make:
2852         * PlatformMac.cmake:
2853         * SourcesCocoa.txt:
2854         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
2855         * WebKit.xcodeproj/project.pbxproj:
2856         * WebProcess/cocoa/RemoteCaptureSampleManager.cpp: Added.
2857         (WebKit::RemoteCaptureSampleManager::RemoteCaptureSampleManager):
2858         (WebKit::RemoteCaptureSampleManager::~RemoteCaptureSampleManager):
2859         (WebKit::RemoteCaptureSampleManager::setConnection):
2860         (WebKit::RemoteCaptureSampleManager::addSource):
2861         (WebKit::RemoteCaptureSampleManager::removeSource):
2862         (WebKit::RemoteCaptureSampleManager::dispatchToThread):
2863         (WebKit::RemoteCaptureSampleManager::storageChanged):
2864         (WebKit::RemoteCaptureSampleManager::audioSamplesAvailable):
2865         * WebProcess/cocoa/RemoteCaptureSampleManager.h: Added.
2866         * WebProcess/cocoa/RemoteCaptureSampleManager.messages.in: Added.
2867         * WebProcess/cocoa/RemoteRealtimeMediaSource.cpp: Added.
2868         (WebKit::RemoteRealtimeMediaSource::RemoteRealtimeMediaSource):
2869         (WebKit::RemoteRealtimeMediaSource::~RemoteRealtimeMediaSource):
2870         (WebKit::RemoteRealtimeMediaSource::whenReady):
2871         (WebKit::RemoteRealtimeMediaSource::didFail):
2872         (WebKit::RemoteRealtimeMediaSource::setAsReady):
2873         (WebKit::RemoteRealtimeMediaSource::clone):
2874         (WebKit::RemoteRealtimeMediaSource::setCapabilities):
2875         (WebKit::RemoteRealtimeMediaSource::setSettings):
2876         (WebKit::RemoteRealtimeMediaSource::remoteAudioSamplesAvailable):
2877         (WebKit::RemoteRealtimeMediaSource::remoteVideoSampleAvailable):
2878         (WebKit::RemoteRealtimeMediaSource::connection):
2879         (WebKit::RemoteRealtimeMediaSource::startProducingData):
2880         (WebKit::RemoteRealtimeMediaSource::stopProducingData):
2881         (WebKit::RemoteRealtimeMediaSource::setShouldApplyRotation):
2882         (WebKit::RemoteRealtimeMediaSource::capabilities):
2883         (WebKit::RemoteRealtimeMediaSource::applyConstraints):
2884         (WebKit::RemoteRealtimeMediaSource::applyConstraintsSucceeded):
2885         (WebKit::RemoteRealtimeMediaSource::applyConstraintsFailed):
2886         (WebKit::RemoteRealtimeMediaSource::hasEnded):
2887         (WebKit::RemoteRealtimeMediaSource::stopBeingObserved):
2888         (WebKit::RemoteRealtimeMediaSource::requestToEnd):
2889         * WebProcess/cocoa/RemoteRealtimeMediaSource.h: Added.
2890         (WebKit::RemoteRealtimeMediaSource::identifier const):
2891         (WebKit::RemoteRealtimeMediaSource::settings const):
2892         (WebKit::RemoteRealtimeMediaSource::setShouldCaptureInGPUProcess):
2893         (WebKit::RemoteRealtimeMediaSource::shouldCaptureInGPUProcess const):
2894         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
2895         (WebKit::UserMediaCaptureManager::createCaptureSource):
2896         (WebKit::UserMediaCaptureManager::cloneSource):
2897         (WebKit::UserMediaCaptureManager::cloneVideoSource):
2898         (WebKit::UserMediaCaptureManager::AudioFactory::createAudioCaptureSource):
2899         (WebKit::UserMediaCaptureManager::AudioFactory::setShouldCaptureInGPUProcess):
2900         (WebKit::UserMediaCaptureManager::VideoFactory::createVideoCaptureSource):
2901         (WebKit::UserMediaCaptureManager::DisplayFactory::createDisplayCaptureSource):
2902         * WebProcess/cocoa/UserMediaCaptureManager.h:
2903         * WebProcess/cocoa/UserMediaCaptureManager.messages.in:
2904
2905 2020-05-08  Youenn Fablet  <youenn@apple.com>
2906
2907         Video capture does not get unmuted in case of tab switch on iOS
2908         https://bugs.webkit.org/show_bug.cgi?id=211509
2909
2910         Reviewed by Eric Carlson.
2911
2912         Remove no longer needed code.
2913
2914         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
2915         (WebKit::UserMediaCaptureManager::VideoFactory::setActiveSource):
2916         * WebProcess/cocoa/UserMediaCaptureManager.h:
2917
2918 2020-05-08  Carlos Garcia Campos  <cgarcia@igalia.com>
2919
2920         Unreviewed. Fix GTK4 build after r261370
2921
2922         * UIProcess/API/gtk/WebKitScriptDialogGtk.cpp:
2923         (webkitScriptDialogIsUserHandled):
2924
2925 2020-05-08  Lauro Moura  <lmoura@igalia.com>
2926
2927         [WPE][WebDriver] Implement user prompt support
2928         https://bugs.webkit.org/show_bug.cgi?id=207372
2929
2930         Reviewed by Carlos Garcia Campos.
2931
2932         Provide a default implementation for WebDriver dialog commands.
2933         This implementation will mimic the expected browser behavior of
2934         accepting/dismissing the dialogs, while not exposing any new API.
2935
2936         * UIProcess/API/glib/WebKitScriptDialogPrivate.h:
2937         - Expose new private function to check whether the dialog is using a
2938         default implementation or is handled by the user.
2939         * UIProcess/API/glib/WebKitWebView.cpp:
2940         - Avoid default WebDriver behavior if the dialog is user-handled.
2941         (webkitWebViewSetCurrentScriptDialogUserInput):
2942         (webkitWebViewAcceptCurrentScriptDialog):
2943         (webkitWebViewDismissCurrentScriptDialog):
2944         * UIProcess/API/gtk/WebKitScriptDialogGtk.cpp:
2945         (webkitScriptDialogIsUserHandled):
2946         - Return whether the dialog is user handled.
2947         * UIProcess/API/wpe/WebKitScriptDialogWPE.cpp:
2948         - Added basic behavior for the WebDriver dialog callbacks for WPE.
2949         (webkitScriptDialogAccept):
2950         (webkitScriptDialogDismiss):
2951         (webkitScriptDialogSetUserInput):
2952         (webkitScriptDialogIsUserHandled):
2953
2954         * UIProcess/API/wpe/WebKitWebViewWPE.cpp:
2955         (webkitWebViewScriptDialog):
2956         - Hold a dialog ref if the webview is controlled by automation and ends
2957         up calling the default "script-dialog" event handler.
2958
2959 2020-05-07  Jiewen Tan  <jiewen_tan@apple.com>
2960
2961         [WebAuthn] Roll back newly created credentials if an error occurs
2962         https://bugs.webkit.org/show_bug.cgi?id=183530
2963         <rdar://problem/43357305>
2964
2965         Reviewed by Brent Fulgham.
2966
2967         We should clean up any newly created credentials if an error occurs before the relying party
2968         registers the identity. Otherwise we are left with a dangling credential.
2969
2970         Covered by API tests.
2971
2972         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.h:
2973         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
2974         (WebKit::LocalAuthenticator::continueMakeCredentialAfterUserVerification):
2975         (WebKit::LocalAuthenticator::continueGetAssertionAfterUserVerification):
2976         (WebKit::LocalAuthenticator::receiveException const):
2977
2978 2020-05-07  Chris Dumez  <cdumez@apple.com>
2979
2980         Unreviewed, reverting r261252.
2981
2982         Reland r260684 now that a proper fix has landed in Reader
2983
2984         Reverted changeset:
2985
2986         "REGRESSION (r260684): Reader background is lost after
2987         multitasking"
2988         https://bugs.webkit.org/show_bug.cgi?id=211533
2989         https://trac.webkit.org/changeset/261252
2990
2991 2020-05-07  Megan Gardner  <megan_gardner@apple.com>
2992
2993         Build Fix for MacCatalyst
2994         https://bugs.webkit.org/show_bug.cgi?id=211601
2995
2996         Reviewed by Tim Horton.
2997
2998         * UIProcess/ios/WKContentViewInteraction.mm:
2999         (-[WKContentView _removeContextMenuViewIfPossible]):
3000
3001 2020-05-07  Chris Dumez  <cdumez@apple.com>
3002
3003         Crash under WebKit::XPCServiceMain
3004         https://bugs.webkit.org/show_bug.cgi?id=211600
3005         <rdar://problem/62875458>
3006
3007         Reviewed by Darin Adler.
3008
3009         Made the following changes:
3010         - Crash under strcmp() could in theory happen if expectedBundleVersion.UTF8String was null, which could
3011           happen if expectedBundleVersion was null. I now use higher level String types for the versions, make
3012           sure they are not null and use String comparison to compare them.
3013         - Call CRASH() instead of __builtin_trap(), to guarantee that we crash with a SIGTRAP (see comment next
3014           to CRASH() macro).
3015         - Move CRASH() call to a crashDueWebKitFrameworkVersionMismatch() never inlined function to make it
3016           clear when it crashes due to a framework version mismatch and distinguish from proper crashes.
3017
3018         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
3019         (WebKit::crashDueWebKitFrameworkVersionMismatch):
3020         (WebKit::XPCServiceMain):
3021
3022 2020-05-07  Youenn Fablet  <youenn@apple.com>
3023
3024         Remove AudioMediaStreamTrackRenderer::muted
3025         https://bugs.webkit.org/show_bug.cgi?id=211289
3026
3027         Reviewed by Eric Carlson.
3028
3029         muted is unnecessary since we are using start/stop instead.
3030
3031         * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer.cpp:
3032         * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer.h:
3033         * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer.messages.in:
3034         * WebProcess/GPU/webrtc/AudioMediaStreamTrackRenderer.cpp:
3035         * WebProcess/GPU/webrtc/AudioMediaStreamTrackRenderer.h:
3036
3037 2020-05-07  Don Olmstead  <don.olmstead@sony.com>
3038
3039         Remove unused USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
3040         https://bugs.webkit.org/show_bug.cgi?id=211582
3041
3042         Reviewed by Fujii Hironori.
3043
3044         After r261264 all ports implemented USE_REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR.
3045
3046         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
3047         (WebKit::ThreadedCompositor::ThreadedCompositor):
3048         (WebKit::m_displayRefreshMonitor):
3049         (WebKit::ThreadedCompositor::invalidate):
3050         (WebKit::ThreadedCompositor::sceneUpdateFinished):
3051         (WebKit::ThreadedCompositor::displayRefreshMonitor):
3052         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
3053         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
3054         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.h:
3055         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3056         (WebKit::WebChromeClient::createDisplayRefreshMonitor const):
3057         * WebProcess/WebCoreSupport/WebChromeClient.h:
3058         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
3059         (WebKit::DrawingAreaCoordinatedGraphics::createDisplayRefreshMonitor):
3060         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h:
3061         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
3062         (WebKit::LayerTreeHost::createDisplayRefreshMonitor):
3063         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h:
3064         (WebKit::LayerTreeHost::deviceOrPageScaleFactorChanged):
3065         * WebProcess/WebPage/DrawingArea.cpp:
3066         * WebProcess/WebPage/DrawingArea.h:
3067         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.h:
3068         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm:
3069         * WebProcess/WebPage/mac/DrawingAreaMac.cpp:
3070
3071 2020-05-07  Darin Adler  <darin@apple.com>
3072
3073         Add some missing null checks for DocumentLoader
3074         https://bugs.webkit.org/show_bug.cgi?id=211544
3075         rdar://62843516
3076
3077         Reviewed by Anders Carlsson.
3078
3079         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3080         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
3081         Add a null check before calling DocumentLoader::response.
3082
3083 2020-05-07  Darin Adler  <darin@apple.com>
3084
3085         Remove USE(INSERTION_UNDO_GROUPING) checks in macOS platform code
3086         https://bugs.webkit.org/show_bug.cgi?id=211525
3087
3088         Reviewed by Anders Carlsson.
3089
3090         * UIProcess/Cocoa/WebViewImpl.mm: Use NSTextInputContextSPI.h.
3091         (WebKit::WebViewImpl::validAttributesForMarkedText): Removed
3092         USE(INSERTION_UNDO_GROUPING) from the macOS-specific code here.
3093         (WebKit::WebViewImpl::insertText): Ditto.
3094         * UIProcess/PageClient.h: Ditto.
3095         * UIProcess/ios/PageClientImplIOS.mm:
3096         (WebKit::PageClientImpl::registerInsertionUndoGrouping): Deleted.
3097         This function is not needed at all on iOS.
3098         * UIProcess/mac/PageClientImplMac.h: Removed USE(INSERTION_UNDO_GROUPING).
3099         * UIProcess/mac/PageClientImplMac.mm:
3100         (WebKit::PageClientImpl::registerInsertionUndoGrouping): Ditto.
3101
3102 2020-05-07  Chris Dumez  <cdumez@apple.com>
3103
3104         Drop dead platformPrepareToSuspend / platformProcessDidResume in NetworkProcess
3105         https://bugs.webkit.org/show_bug.cgi?id=211579
3106
3107         Reviewed by Geoffrey Garen.
3108
3109         * NetworkProcess/NetworkProcess.cpp:
3110         (WebKit::NetworkProcess::prepareToSuspend):
3111         (WebKit::NetworkProcess::resume):
3112         * NetworkProcess/NetworkProcess.h:
3113         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3114         (WebKit::NetworkProcess::platformPrepareToSuspend): Deleted.
3115         (WebKit::NetworkProcess::platformProcessDidResume): Deleted.
3116         * NetworkProcess/curl/NetworkProcessCurl.cpp:
3117         (WebKit::NetworkProcess::platformPrepareToSuspend): Deleted.
3118         (WebKit::NetworkProcess::platformProcessDidResume): Deleted.
3119         * NetworkProcess/soup/NetworkProcessSoup.cpp:
3120         (WebKit::NetworkProcess::platformPrepareToSuspend): Deleted.
3121         (WebKit::NetworkProcess::platformProcessDidResume): Deleted.
3122
3123 2020-05-07  Megan Gardner  <megan_gardner@apple.com>
3124
3125         ContextMenu: entire webpage pops and disappears to generate preview of embedded image
3126         https://bugs.webkit.org/show_bug.cgi?id=211272
3127         <rdar://problem/62482013>
3128
3129         Reviewed by Tim Horton.
3130
3131         The ActionSheetAssistant is always around, so using the presence of one
3132         to determine if we need to remove the _contextMenuHintContainerView is incorrect
3133         and causes it to be around on the next invocation of the context menu, and 
3134         causing the failure of the creation of a new preview, which then will default to
3135         popping the whole page. We need to ask the ActionSheetAssistant if it is actively showing
3136         anything, and then correctly clean up the _contextMenuHintContainerView after the 
3137         end of the interactions for FileUploadMenu and ActionSheetAssistant are done with their
3138         interactions. 
3139
3140         * UIProcess/ios/WKActionSheetAssistant.h:
3141         * UIProcess/ios/WKActionSheetAssistant.mm:
3142         (-[WKActionSheetAssistant removeContextMenuInteraction]):
3143         (-[WKActionSheetAssistant hasContextMenuInteraction]):
3144         * UIProcess/ios/WKContentViewInteraction.h:
3145         * UIProcess/ios/WKContentViewInteraction.mm:
3146         (-[WKContentView removeContextMenuViewIfPossibleForActionSheetAssistant:]):
3147         (-[WKContentView _canRemoveContextMenuView]):
3148         (-[WKContentView _removeContextMenuViewIfPossible]):
3149         (-[WKContentView contextMenuInteraction:willEndForConfiguration:animator:]):
3150         * UIProcess/ios/forms/WKFileUploadPanel.mm:
3151         (-[WKFileUploadPanel removeContextMenuInteraction]):
3152
3153 2020-05-07  Chris Dumez  <cdumez@apple.com>
3154
3155         Simplify several IPC sending call sites in the UIProcess
3156         https://bugs.webkit.org/show_bug.cgi?id=211575
3157
3158         Reviewed by Alex Christensen.
3159
3160         Simplify several IPC sending call sites in the UIProcess by leveraging the fact
3161         that WebPageProxy subclasses IPC::MessageSender.
3162
3163         * UIProcess/Cocoa/TextCheckingController.mm:
3164         (WebKit::TextCheckingController::replaceRelativeToSelection):
3165         (WebKit::TextCheckingController::removeAnnotationRelativeToSelection):
3166         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
3167         (WebKit::WebPageProxy::performDictionaryLookupAtLocation):
3168         (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection):
3169         (WebKit::WebPageProxy::insertDictatedTextAsync):
3170         (WebKit::WebPageProxy::speakingErrorOccurred):
3171         (WebKit::WebPageProxy::boundaryEventOccurred):
3172         (WebKit::WebPageProxy::voicesDidChange):
3173         * UIProcess/GeolocationPermissionRequestManagerProxy.cpp:
3174         (WebKit::GeolocationPermissionRequestManagerProxy::didReceiveGeolocationPermissionDecision):
3175         * UIProcess/Inspector/RemoteWebInspectorProxy.cpp:
3176         (WebKit::RemoteWebInspectorProxy::setDiagnosticLoggingAvailable):
3177         * UIProcess/Inspector/WebInspectorProxy.cpp:
3178         (WebKit::WebInspectorProxy::setDiagnosticLoggingAvailable):
3179         * UIProcess/Inspector/gtk/RemoteWebInspectorProxyGtk.cpp:
3180         (WebKit::remoteFileReplaceContentsCallback):
3181         * UIProcess/Inspector/gtk/WebInspectorProxyGtk.cpp:
3182         (WebKit::fileReplaceContentsCallback):
3183         * UIProcess/Inspector/mac/RemoteWebInspectorProxyMac.mm:
3184         (WebKit::RemoteWebInspectorProxy::platformSave):
3185         (WebKit::RemoteWebInspectorProxy::platformAppend):
3186         * UIProcess/Inspector/mac/WebInspectorProxyMac.mm:
3187         (WebKit::WebInspectorProxy::platformSave):
3188         (WebKit::WebInspectorProxy::platformAppend):
3189         * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp:
3190         (WebKit::NotificationPermissionRequestManagerProxy::createRequest):
3191         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3192         (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
3193         (WebKit::UserMediaPermissionRequestManagerProxy::denyRequest):
3194         * UIProcess/WebFrameProxy.cpp:
3195         (WebKit::WebFrameProxy::collapseSelection):
3196         * UIProcess/WebFullScreenManagerProxy.cpp:
3197         (WebKit::WebFullScreenManagerProxy::willEnterFullScreen):
3198         (WebKit::WebFullScreenManagerProxy::didEnterFullScreen):
3199         (WebKit::WebFullScreenManagerProxy::willExitFullScreen):
3200         (WebKit::WebFullScreenManagerProxy::didExitFullScreen):
3201         (WebKit::WebFullScreenManagerProxy::setAnimatingFullScreen):
3202         (WebKit::WebFullScreenManagerProxy::requestExitFullScreen):
3203         (WebKit::WebFullScreenManagerProxy::saveScrollPosition):
3204         (WebKit::WebFullScreenManagerProxy::restoreScrollPosition):
3205         (WebKit::WebFullScreenManagerProxy::setFullscreenInsets):
3206         (WebKit::WebFullScreenManagerProxy::setFullscreenAutoHideDuration):
3207         (WebKit::WebFullScreenManagerProxy::setFullscreenControlsHidden):
3208         * UIProcess/gtk/WebPageProxyGtk.cpp:
3209         (WebKit::WebPageProxy::getCenterForZoomGesture):
3210         * UIProcess/ios/SmartMagnificationController.mm:
3211         (WebKit::SmartMagnificationController::handleSmartMagnificationGesture):
3212         * UIProcess/ios/WKContentViewInteraction.mm:
3213         (-[WKContentView ensurePositionInformationIsUpToDate:]):
3214         * UIProcess/ios/WebPageProxyIOS.mm:
3215         (WebKit::WebPageProxy::handleTwoFingerTapAtPoint):
3216         (WebKit::WebPageProxy::handleStylusSingleTapAtPoint):
3217         (WebKit::WebPageProxy::registerUIProcessAccessibilityTokens):
3218         (WebKit::WebPageProxy::willStartUserTriggeredZooming):
3219         (WebKit::WebPageProxy::potentialTapAtPosition):
3220         (WebKit::WebPageProxy::commitPotentialTap):
3221         (WebKit::WebPageProxy::cancelPotentialTap):
3222         (WebKit::WebPageProxy::tapHighlightAtPosition):
3223         (WebKit::WebPageProxy::handleTap):
3224         (WebKit::WebPageProxy::didRecognizeLongPress):
3225         (WebKit::WebPageProxy::handleDoubleTapForDoubleClickAtPoint):
3226         (WebKit::WebPageProxy::inspectorNodeSearchMovedToPosition):
3227         (WebKit::WebPageProxy::inspectorNodeSearchEndedAtPosition):
3228         (WebKit::WebPageProxy::blurFocusedElement):
3229         (WebKit::WebPageProxy::setIsShowingInputViewForFocusedElement):
3230         (WebKit::WebPageProxy::setFocusedElementValue):
3231         (WebKit::WebPageProxy::setFocusedElementValueAsNumber):
3232         (WebKit::WebPageProxy::setFocusedElementSelectedIndex):
3233         (WebKit::WebPageProxy::computePagesForPrintingAndDrawToPDF):
3234         (WebKit::WebPageProxy::contentSizeCategoryDidChange):
3235         (WebKit::WebPageProxy::generateSyntheticEditingCommand):
3236         * UIProcess/mac/ViewGestureControllerMac.mm:
3237         (WebKit::ViewGestureController::handleMagnificationGestureEvent):
3238         (WebKit::ViewGestureController::handleSmartMagnificationGesture):
3239         * UIProcess/mac/WebPageProxyMac.mm:
3240         (WebKit::WebPageProxy::windowAndViewFramesChanged):
3241         (WebKit::WebPageProxy::setMainFrameIsScrollable):
3242         (WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync):
3243         (WebKit::WebPageProxy::fontAtSelection):
3244         (WebKit::WebPageProxy::stringSelectionForPasteboard):
3245         (WebKit::WebPageProxy::dataSelectionForPasteboard):
3246         (WebKit::WebPageProxy::readSelectionFromPasteboard):
3247         (WebKit::WebPageProxy::replaceSelectionWithPasteboardData):
3248         (WebKit::WebPageProxy::sendComplexTextInputToPlugin):
3249         (WebKit::WebPageProxy::uppercaseWord):
3250         (WebKit::WebPageProxy::lowercaseWord):
3251         (WebKit::WebPageProxy::capitalizeWord):
3252         (WebKit::WebPageProxy::setSmartInsertDeleteEnabled):
3253         (WebKit::WebPageProxy::registerUIProcessAccessibilityTokens):
3254         (WebKit::WebPageProxy::shouldDelayWindowOrderingForEvent):
3255         (WebKit::WebPageProxy::acceptsFirstMouse):
3256
3257 2020-05-07  Commit Queue  <commit-queue@webkit.org>
3258
3259         Unreviewed, reverting r260769.
3260         https://bugs.webkit.org/show_bug.cgi?id=211578
3261
3262         Introduced regressions related to sharing (Requested by
3263         perarne on #webkit).
3264
3265         Reverted changeset:
3266
3267         "[Cocoa] After r258891, r255119 can be reverted"
3268         https://bugs.webkit.org/show_bug.cgi?id=211083
3269         https://trac.webkit.org/changeset/260769
3270
3271 2020-05-07  Chris Dumez  <cdumez@apple.com>
3272
3273         [iOS] AuxiliaryProcessProxy::sendWithAsyncReply() should prevent auxiliary process suspension while processing the IPC
3274         https://bugs.webkit.org/show_bug.cgi?id=209928
3275
3276         Reviewed by Youenn Fablet.
3277
3278         AuxiliaryProcessProxy::sendWithAsyncReply() should prevent auxiliary process suspension
3279         on iOS while processing the IPC. If the process is suspended either before or during
3280         the IPC, this could result in hangs. This is a speculative fix for the flaky timeouts
3281         we see on many tests on iOS only. We know that missing activities with
3282         sendWithAsyncReply has caused test timeouts in the past (Bug 211421).
3283
3284         * UIProcess/AuxiliaryProcessProxy.cpp:
3285         (WebKit::AuxiliaryProcessProxy::sendMessage):
3286         * UIProcess/AuxiliaryProcessProxy.h:
3287         (WebKit::AuxiliaryProcessProxy::sendWithAsyncReply):
3288         * UIProcess/GPU/GPUProcessProxy.cpp:
3289         (WebKit::GPUProcessProxy::getGPUProcessConnection):
3290         * UIProcess/GPU/GPUProcessProxy.h:
3291         * UIProcess/Network/NetworkProcessProxy.cpp:
3292         (WebKit::NetworkProcessProxy::getNetworkProcessConnection):
3293         (WebKit::NetworkProcessProxy::setUseITPDatabase):
3294         (WebKit::NetworkProcessProxy::resetCacheMaxAgeCapForPrevalentResources):
3295         (WebKit::NetworkProcessProxy::resetParametersToDefaultValues):
3296         (WebKit::NetworkProcessProxy::scheduleClearInMemoryAndPersistent):
3297         (WebKit::NetworkProcessProxy::resetCrossSiteLoadsWithLinkDecorationForTesting):
3298         (WebKit::NetworkProcessProxy::setAppBoundDomainsForResourceLoadStatistics):
3299         (WebKit::NetworkProcessProxy::setShouldDowngradeReferrerForTesting):
3300         (WebKit::NetworkProcessProxy::setThirdPartyCookieBlockingMode):
3301         (WebKit::NetworkProcessProxy::setShouldEnbleSameSiteStrictEnforcementForTesting):
3302         (WebKit::NetworkProcessProxy::setFirstPartyWebsiteDataRemovalModeForTesting):
3303         (WebKit::NetworkProcessProxy::sendPrepareToSuspend):
3304         * UIProcess/Network/NetworkProcessProxy.h:
3305         * UIProcess/Plugins/PluginProcessProxy.cpp:
3306         (WebKit::PluginProcessProxy::PluginProcessProxy):
3307         * UIProcess/Plugins/PluginProcessProxy.h:
3308         * UIProcess/ProcessThrottler.h:
3309         (WebKit::ProcessThrottler::Activity::Activity):
3310         (WebKit::ProcessThrottler::Activity::isQuietActivity const):
3311         (WebKit::ProcessThrottler::Activity::invalidate):
3312         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3313         (WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest):
3314         * UIProcess/WebBackForwardCacheEntry.cpp:
3315         (WebKit::WebBackForwardCacheEntry::~WebBackForwardCacheEntry):
3316         * UIProcess/WebCookieManagerProxy.cpp:
3317         (WebKit::WebCookieManagerProxy::getHostnamesWithCookies):
3318         (WebKit::WebCookieManagerProxy::deleteCookie):
3319         (WebKit::WebCookieManagerProxy::deleteAllCookiesModifiedSince):
3320         (WebKit::WebCookieManagerProxy::setCookies):
3321         (WebKit::WebCookieManagerProxy::getAllCookies):
3322         (WebKit::WebCookieManagerProxy::getCookies):
3323         (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):
3324         (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):
3325         * UIProcess/WebPageProxy.cpp:
3326         (WebKit::WebPageProxy::getProcessDisplayName):
3327         * UIProcess/WebProcessProxy.cpp:
3328         (WebKit::WebProcessProxy::setThirdPartyCookieBlockingMode):
3329         (WebKit::WebProcessProxy::fetchWebsiteData):
3330         (WebKit::WebProcessProxy::deleteWebsiteData):
3331         (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
3332         (WebKit::WebProcessProxy::sendPrepareToSuspend):
3333         (WebKit::WebProcessProxy::activePagesDomainsForTesting):
3334         (WebKit::WebProcessProxy::establishServiceWorkerContext):
3335         * UIProcess/WebProcessProxy.h:
3336         * UIProcess/ios/WebPageProxyIOS.mm:
3337         (WebKit::WebPageProxy::insertTextPlaceholder):
3338         (WebKit::WebPageProxy::removeTextPlaceholder):
3339         (WebKit::WebPageProxy::requestAutocorrectionData):
3340         (WebKit::WebPageProxy::requestEvasionRectsAboveSelection):
3341         (WebKit::WebPageProxy::updateSelectionWithDelta):
3342         (WebKit::WebPageProxy::requestDocumentEditingContext):
3343         (WebKit::WebPageProxy::insertDroppedImagePlaceholders):
3344
3345 2020-05-07  Carlos Garcia Campos  <cgarcia@igalia.com>
3346
3347         [GTK] REGRESSION(r260996): Pressing <Tab> in an HTTP authentication dialog makes the dialog lose focus
3348         https://bugs.webkit.org/show_bug.cgi?id=211555
3349
3350         Reviewed by Philippe Normand.
3351
3352         Bring back webkitWebViewBaseFocus to GTK3. I made it GTK4 only by mistake in r260996.
3353
3354         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3355         (webkitWebViewBaseFocus):
3356         (webkit_web_view_base_class_init):
3357
3358 2020-05-07  Philippe Normand  <pnormand@igalia.com>
3359
3360         [GTK] Build warning fixes
3361
3362         Rubber-stamped by Žan Doberšek.
3363
3364         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3365         (webkitWebViewBaseGrabFocus):
3366         * UIProcess/GPU/GPUProcessProxy.cpp:
3367         (WebKit::GPUProcessProxy::getGPUProcessConnection):
3368         * UIProcess/Network/NetworkProcessProxy.cpp:
3369         (WebKit::NetworkProcessProxy::getNetworkProcessConnection):
3370
3371 2020-05-07  Youenn Fablet  <youenn@apple.com>
3372
3373         Sending WebRTC network packets should not go through the main thread
3374         https://bugs.webkit.org/show_bug.cgi?id=211291
3375
3376         Reviewed by Eric Carlson.
3377
3378         Following on receiving RTC packets from a background thread, we also send RTC packets from a background thread.
3379         Creation of the sockets also happens in a background thread.
3380         LibWebRTCNetwork is getting the connection whenever a new connection to network process is created.
3381         It will then hop to the RTC network thread to set the IPC connection to the libwebrtc socket factory.
3382
3383         At creation of the socket, we get the IPC connection to the network process and keep a ref in the RTC socket.
3384         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.
3385         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.
3386
3387         Covered by existing tests.
3388
3389         * WebProcess/Network/webrtc/LibWebRTCNetwork.cpp:
3390         (WebKit::LibWebRTCNetwork::setAsActive):
3391         (WebKit::LibWebRTCNetwork::setConnection):
3392         (WebKit::LibWebRTCNetwork::dispatchToThread):
3393         * WebProcess/Network/webrtc/LibWebRTCNetwork.h:
3394         (WebKit::LibWebRTCNetwork::connection):
3395         (WebKit::LibWebRTCNetwork::isActive const):
3396         * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
3397         (WebKit::LibWebRTCProvider::startedNetworkThread):
3398         * WebProcess/Network/webrtc/LibWebRTCProvider.h:
3399         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
3400         (WebKit::LibWebRTCSocket::SendTo):
3401         (WebKit::LibWebRTCSocket::Close):
3402         (WebKit::LibWebRTCSocket::SetOption):
3403         (WebKit::LibWebRTCSocket::suspend):
3404         * WebProcess/Network/webrtc/LibWebRTCSocket.h:
3405         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
3406         (WebKit::LibWebRTCSocketFactory::setConnection):
3407         (WebKit::LibWebRTCSocketFactory::connection):
3408         (WebKit::LibWebRTCSocketFactory::createServerTcpSocket):
3409         (WebKit::LibWebRTCSocketFactory::createUdpSocket):
3410         (WebKit::LibWebRTCSocketFactory::createClientTcpSocket):
3411         (WebKit::LibWebRTCSocketFactory::createNewConnectionSocket):
3412         (WebKit::LibWebRTCSocketFactory::addSocket):
3413         (WebKit::LibWebRTCSocketFactory::removeSocket):
3414         (WebKit::LibWebRTCSocketFactory::forSocketInGroup):
3415         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.h:
3416
3417 2020-05-07  Adrian Perez de Castro  <aperez@igalia.com>
3418
3419         [GTK4] Stop using the GtkWidget.destroy vfunc
3420         https://bugs.webkit.org/show_bug.cgi?id=211553
3421
3422         Reviewed by Carlos Garcia Campos.
3423
3424         No new tests needed.
3425
3426         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3427         (webkitWebViewBaseDestroy): Removed.
3428         (webkitWebViewBaseDispose): Bring in the code from the removed function, adapt
3429         to use g_clear_pointer() to destroy the nested dialog.
3430         (webkit_web_view_base_class_init): Do not set the GtkWidget.destroy vfunc.
3431
3432 2020-05-07  Philippe Normand  <pnormand@igalia.com>
3433
3434         [WPE][Qt] Enable by default
3435         https://bugs.webkit.org/show_bug.cgi?id=211517
3436
3437         Reviewed by Adrian Perez de Castro.
3438
3439         * PlatformWPE.cmake: Fix WPEQt build.
3440
3441
3442 2020-05-06  Alex Christensen  <achristensen@webkit.org>
3443
3444         Fix webkitpy tests after r261254
3445         https://bugs.webkit.org/show_bug.cgi?id=211112
3446
3447         test.messages.in was accidentally deleted instead of moved, and messages_unittest.py needed to be told of the new locations of results.
3448         The rest is just running the generator to update results.
3449
3450         * Scripts/MessageNames.cpp:
3451         (IPC::description):
3452         (IPC::receiverName):
3453         (IPC::isValidMessageName):
3454         * Scripts/MessageNames.h:
3455         * Scripts/testMessageReceiver.cpp:
3456         (Messages::WebPage::GetPluginProcessConnection::send):
3457         (Messages::WebPage::TestMultipleAttributes::send):
3458         (WebKit::WebPage::didReceiveMessage):
3459         (WebKit::WebPage::didReceiveSyncMessage):
3460         * Scripts/testMessages.h:
3461         (Messages::WebPage::messageReceiverName):
3462         (Messages::WebPage::LoadURL::name):
3463         (Messages::WebPage::LoadURL::LoadURL):
3464         (Messages::WebPage::LoadURL::arguments const):
3465         (Messages::WebPage::LoadSomething::name):
3466         (Messages::WebPage::LoadSomething::LoadSomething):
3467         (Messages::WebPage::LoadSomething::arguments const):
3468         (Messages::WebPage::TouchEvent::name):
3469         (Messages::WebPage::TouchEvent::TouchEvent):
3470         (Messages::WebPage::TouchEvent::arguments const):
3471         (Messages::WebPage::AddEvent::name):
3472         (Messages::WebPage::AddEvent::AddEvent):
3473         (Messages::WebPage::AddEvent::arguments const):
3474         (Messages::WebPage::LoadSomethingElse::name):
3475         (Messages::WebPage::LoadSomethingElse::LoadSomethingElse):
3476         (Messages::WebPage::LoadSomethingElse::arguments const):
3477         (Messages::WebPage::DidReceivePolicyDecision::name):
3478         (Messages::WebPage::DidReceivePolicyDecision::DidReceivePolicyDecision):
3479         (Messages::WebPage::DidReceivePolicyDecision::arguments const):
3480         (Messages::WebPage::Close::name):
3481         (Messages::WebPage::Close::arguments const):
3482         (Messages::WebPage::PreferencesDidChange::name):
3483         (Messages::WebPage::PreferencesDidChange::PreferencesDidChange):
3484         (Messages::WebPage::PreferencesDidChange::arguments const):
3485         (Messages::WebPage::SendDoubleAndFloat::name):
3486         (Messages::WebPage::SendDoubleAndFloat::SendDoubleAndFloat):
3487         (Messages::WebPage::SendDoubleAndFloat::arguments const):
3488         (Messages::WebPage::SendInts::name):
3489         (Messages::WebPage::SendInts::SendInts):
3490         (Messages::WebPage::SendInts::arguments const):
3491         (Messages::WebPage::CreatePlugin::name):
3492         (Messages::WebPage::CreatePlugin::CreatePlugin):
3493         (Messages::WebPage::CreatePlugin::arguments const):
3494         (Messages::WebPage::RunJavaScriptAlert::name):
3495         (Messages::WebPage::RunJavaScriptAlert::RunJavaScriptAlert):
3496         (Messages::WebPage::RunJavaScriptAlert::arguments const):
3497         (Messages::WebPage::GetPlugins::name):
3498         (Messages::WebPage::GetPlugins::GetPlugins):
3499         (Messages::WebPage::GetPlugins::arguments const):
3500         (Messages::WebPage::GetPluginProcessConnection::name):
3501         (Messages::WebPage::GetPluginProcessConnection::GetPluginProcessConnection):
3502         (Messages::WebPage::GetPluginProcessConnection::arguments const):
3503         (Messages::WebPage::TestMultipleAttributes::name):
3504         (Messages::WebPage::TestMultipleAttributes::arguments const):
3505         (Messages::WebPage::TestParameterAttributes::name):
3506         (Messages::WebPage::TestParameterAttributes::TestParameterAttributes):
3507         (Messages::WebPage::TestParameterAttributes::arguments const):
3508         (Messages::WebPage::TemplateTest::name):
3509         (Messages::WebPage::TemplateTest::TemplateTest):
3510         (Messages::WebPage::TemplateTest::arguments const):
3511         (Messages::WebPage::SetVideoLayerID::name):
3512         (Messages::WebPage::SetVideoLayerID::SetVideoLayerID):
3513         (Messages::WebPage::SetVideoLayerID::arguments const):
3514         (Messages::WebPage::DidCreateWebProcessConnection::name):
3515         (Messages::WebPage::DidCreateWebProcessConnection::DidCreateWebProcessConnection):
3516         (Messages::WebPage::DidCreateWebProcessConnection::arguments const):
3517         (Messages::WebPage::InterpretKeyEvent::name):
3518         (Messages::WebPage::InterpretKeyEvent::InterpretKeyEvent):
3519         (Messages::WebPage::InterpretKeyEvent::arguments const):
3520         (Messages::WebPage::DeprecatedOperation::name):
3521         (Messages::WebPage::DeprecatedOperation::DeprecatedOperation):
3522         (Messages::WebPage::DeprecatedOperation::arguments const):
3523         (Messages::WebPage::ExperimentalOperation::name):
3524         (Messages::WebPage::ExperimentalOperation::ExperimentalOperation):
3525         (Messages::WebPage::ExperimentalOperation::arguments const):
3526         (Messages::None::messageReceiverName): Deleted.
3527         * Scripts/testMessagesReplies.h:
3528         * Scripts/webkit/messages_unittest.py:
3529         * Scripts/webkit/test.messages.in: Added.
3530
3531 2020-05-06  Megan Gardner  <megan_gardner@apple.com>
3532
3533         Context Menus presented from the wrong location when presented from sub-frames
3534         https://bugs.webkit.org/show_bug.cgi?id=211537
3535         <rdar://problem/60390846>
3536
3537         Reviewed by Tim Horton.
3538
3539         The calculation for bounds for selection Information did not take frames into account,
3540         so if a frame was used, the location would not be correct in the context of the whole
3541         page, so the presentation location ended up being way off.
3542
3543         * UIProcess/ios/forms/WKFileUploadPanel.mm:
3544         (-[WKFileUploadPanel showDocumentPickerMenu]):
3545         * WebProcess/WebPage/ios/WebPageIOS.mm:
3546         (WebKit::boundsPositionInformation):
3547         (WebKit::selectionPositionInformation):
3548
3549 2020-05-06  Commit Queue  <commit-queue@webkit.org>
3550
3551         Unreviewed, reverting r260689.
3552         https://bugs.webkit.org/show_bug.cgi?id=211542
3553
3554         "Caused regressions deleting text and filling password fields"
3555         (Requested by ddkilzer on #webkit).
3556
3557         Reverted changeset:
3558
3559         "WebPasteboardProxy::getPasteboardStringsForType() and
3560         WebPasteboardProxy::readURLFromPasteboard() should check
3561         return value of SharedMemory::createHandle()"
3562         https://bugs.webkit.org/show_bug.cgi?id=211002
3563         https://trac.webkit.org/changeset/260689
3564
3565 2020-05-06  Zalan Bujtas  <zalan@apple.com>
3566
3567         [ContentObservation] Shutterstock search bar is not activated on the first tap
3568         https://bugs.webkit.org/show_bug.cgi?id=211529
3569         <rdar://problem/58843932>
3570
3571         Reviewed by Simon Fraser.
3572
3573         Shutterstock has a “initial click” action which converts some “actionable” elements (<a>) to some other “actionable” elements (<button>).
3574         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).
3575         Any subsequent click works as expected.
3576         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.
3577         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
3578         the Shutterstock top menu bar works fine with click events.)
3579
3580         * WebProcess/WebPage/WebPage.cpp:
3581         (WebKit::WebPage::didStartPageTransition):
3582         * WebProcess/WebPage/WebPage.h:
3583         * WebProcess/WebPage/ios/WebPageIOS.mm:
3584         (WebKit::WebPage::handleSyntheticClick):
3585
3586 2020-05-06  Wenson Hsieh  <wenson_hsieh@apple.com>
3587
3588         Use CocoaColor in more places instead of platform defines
3589         https://bugs.webkit.org/show_bug.cgi?id=211527
3590
3591         Reviewed by Darin Adler and Tim Horton.
3592
3593         Use CocoaColor (added in r261247) in more places, and also introduce `CocoaFont.h` and use it to simplify some
3594         existing code that uses platform ifdefs for UIFont, NSFont, UIFontDescriptor and NSFontDescriptor.
3595
3596         No change in behavior.
3597
3598         * Platform/cocoa/CocoaColor.h:
3599         * Platform/cocoa/CocoaFont.h: Copied from Source/WebKit/Platform/cocoa/CocoaColor.h.
3600         * Platform/cocoa/CocoaImage.h:
3601
3602         Change `@class`es to `OBJC_CLASS`, so that this header can be safely imported in C++ code.
3603
3604         * Shared/Cocoa/ArgumentCodersCocoa.mm:
3605         (IPC::typeFromObject):
3606         (IPC::isSerializableValue):
3607         (IPC::encodeFontInternal):
3608         (IPC::encodeObject):
3609         (IPC::platformColorClass): Deleted.
3610         (IPC::platformFontClass): Deleted.
3611         * Shared/Cocoa/CoreTextHelpers.h:
3612         * Shared/Cocoa/CoreTextHelpers.mm:
3613         (WebKit::fontWithAttributes):
3614         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
3615         * UIProcess/Cocoa/WKSafeBrowsingWarning.h:
3616         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
3617         (fontOfSize):
3618         (colorForItem):
3619         (-[WKSafeBrowsingBox setSafeBrowsingBackgroundColor:]):
3620         (-[WKSafeBrowsingWarning showDetailsClicked]):
3621         (-[WKSafeBrowsingTextView initWithAttributedString:forWarning:]):
3622         * UIProcess/Cocoa/WebViewImpl.mm:
3623         (WebKit::WebViewImpl::updateFontManagerIfNeeded):
3624         * WebKit.xcodeproj/project.pbxproj:
3625
3626 2020-05-06  Alex Christensen  <achristensen@webkit.org>
3627
3628         Reduce IPC overhead for message receiver name and message name to 2 bytes
3629         https://bugs.webkit.org/show_bug.cgi?id=211112
3630
3631         Reviewed by Chris Dumez.
3632
3633         * DerivedSources-output.xcfilelist:
3634         * DerivedSources.make:
3635         * GPUProcess/GPUConnectionToWebProcess.cpp:
3636         (WebKit::GPUConnectionToWebProcess::didReceiveInvalidMessage):
3637         * GPUProcess/GPUConnectionToWebProcess.h:
3638         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3639         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
3640         (WebKit::NetworkConnectionToWebProcess::didReceiveSyncMessage):
3641         (WebKit::NetworkConnectionToWebProcess::didReceiveInvalidMessage):
3642         * NetworkProcess/NetworkConnectionToWebProcess.h:
3643         * NetworkProcess/NetworkProcess.cpp:
3644         (WebKit::NetworkProcess::didReceiveMessage):
3645         (WebKit::NetworkProcess::didReceiveSyncMessage):
3646         * NetworkProcess/ios/NetworkConnectionToWebProcessIOS.mm:
3647         (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorAddMessageReceiver): Deleted.
3648         (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorRemoveMessageReceiver): Deleted.
3649         * Platform/IPC/Connection.cpp:
3650         (IPC::Connection::WaitForMessageState::WaitForMessageState):
3651         (IPC::Connection::addWorkQueueMessageReceiver):
3652         (IPC::Connection::removeWorkQueueMessageReceiver):
3653         (IPC::Connection::dispatchWorkQueueMessageReceiverMessage):
3654         (IPC::Connection::addThreadMessageReceiver):
3655         (IPC::Connection::removeThreadMessageReceiver):
3656         (IPC::Connection::dispatchThreadMessageReceiverMessage):
3657         (IPC::Connection::createSyncMessageEncoder):
3658         (IPC::Connection::sendMessage):
3659         (IPC::Connection::waitForMessage):
3660         (IPC::Connection::sendSyncMessage):
3661         (IPC::Connection::waitForSyncReply):
3662         (IPC::Connection::processIncomingMessage):
3663         (IPC::Connection::dispatchSyncMessage):
3664         (IPC::Connection::dispatchDidReceiveInvalidMessage):
3665         (IPC::Connection::dispatchMessage):
3666         (IPC::Connection::dispatchMessageToWorkQueueReceiver):
3667         (IPC::Connection::dispatchMessageToThreadReceiver):
3668         (IPC::Connection::dispatchIncomingMessages):
3669         * Platform/IPC/Connection.h:
3670         (IPC::Connection::send):
3671         (IPC::Connection::sendWithAsyncReply):
3672         (IPC::Connection::sendSync):
3673         (IPC::Connection::waitForAndDispatchImmediately):
3674         * Platform/IPC/Decoder.cpp:
3675         * Platform/IPC/Decoder.h:
3676         (IPC::Decoder::messageReceiverName const):
3677         (IPC::Decoder::messageName const):
3678         (IPC::Decoder::decode):
3679         (IPC::Decoder::operator>>):
3680         * Platform/IPC/Encoder.cpp:
3681         (IPC::Encoder::Encoder):
3682         (IPC::Encoder::encodeHeader):
3683         * Platform/IPC/Encoder.h:
3684         * Platform/IPC/HandleMessage.h:
3685         (IPC::handleMessageAsync):
3686         * Platform/IPC/MessageReceiverMap.cpp:
3687         (IPC::MessageReceiverMap::addMessageReceiver):
3688         (IPC::MessageReceiverMap::removeMessageReceiver):
3689         (IPC::MessageReceiverMap::dispatchMessage):
3690         (IPC::MessageReceiverMap::dispatchSyncMessage):
3691         * Platform/IPC/MessageReceiverMap.h:
3692         * Platform/IPC/MessageSender.h:
3693         * Platform/IPC/cocoa/ConnectionCocoa.mm:
3694         (IPC::Connection::open):
3695         (IPC::Connection::sendMessage):
3696         (IPC::Connection::sendOutgoingMessage):
3697         (IPC::Connection::receiveSourceEventHandler):
3698         * Platform/IPC/cocoa/MachMessage.cpp:
3699         (IPC::MachMessage::create):
3700         (IPC::MachMessage::MachMessage):
3701         * Platform/IPC/cocoa/MachMessage.h:
3702         (IPC::MachMessage::messageReceiverName const):
3703         (IPC::MachMessage::messageName const):
3704         * PluginProcess/WebProcessConnection.cpp:
3705         (WebKit::WebProcessConnection::didReceiveInvalidMessage):
3706         * PluginProcess/WebProcessConnection.h:
3707         * Scripts/Makefile:
3708         * Scripts/generate-message-receiver.py:
3709         (main):
3710         * Scripts/webkit/LegacyMessages-expected.h: Removed.
3711         * Scripts/webkit/LegacyMessagesReplies-expected.h: Removed.
3712         * Scripts/webkit/MessageNames.cpp: Added.
3713         (IPC::description):
3714         * Scripts/webkit/MessageNames.h: Added.
3715         (IPC::receiverName):
3716         (WTF::isValidEnum):
3717         * Scripts/webkit/MessageReceiver-expected.cpp: Removed.
3718         * Scripts/webkit/MessageReceiverSuperclass-expected.cpp: Removed.
3719         * Scripts/webkit/Messages-expected.h: Removed.
3720         * Scripts/webkit/MessagesReplies-expected.h: Removed.
3721         * Scripts/webkit/MessagesRepliesSuperclassReplies-expected.h: Removed.
3722         * Scripts/webkit/MessagesSuperclass-expected.h: Removed.
3723         * Scripts/webkit/messages.py:
3724         * Scripts/webkit/test-legacy-messages.in: Removed.
3725         * Scripts/webkit/test-legacy.messages.in: Copied from Source/WebKit/Scripts/webkit/test-legacy-messages.in.
3726         * Scripts/webkit/test-legacyMessageReceiver.cpp: Added.
3727         (Messages::WebPage::GetPluginProcessConnection::send):
3728         (Messages::WebPage::TestMultipleAttributes::send):
3729         (WebKit::WebPage::didReceiveWebPageMessage):
3730         (WebKit::WebPage::didReceiveSyncWebPageMessage):
3731         * Scripts/webkit/test-legacyMessages.h: Added.
3732         (Messages::WebPage::messageReceiverName):
3733         (Messages::WebPage::LoadURL::name):
3734         (Messages::WebPage::LoadURL::LoadURL):
3735         (Messages::WebPage::LoadURL::arguments const):
3736         (Messages::WebPage::LoadSomething::name):
3737         (Messages::WebPage::LoadSomething::LoadSomething):
3738         (Messages::WebPage::LoadSomething::arguments const):
3739         (Messages::WebPage::TouchEvent::name):
3740         (Messages::WebPage::TouchEvent::TouchEvent):
3741         (Messages::WebPage::TouchEvent::arguments const):
3742         (Messages::WebPage::AddEvent::name):
3743         (Messages::WebPage::AddEvent::AddEvent):
3744         (Messages::WebPage::AddEvent::arguments const):
3745         (Messages::WebPage::LoadSomethingElse::name):
3746         (Messages::WebPage::LoadSomethingElse::LoadSomethingElse):
3747         (Messages::WebPage::LoadSomethingElse::arguments const):
3748         (Messages::WebPage::DidReceivePolicyDecision::name):
3749         (Messages::WebPage::DidReceivePolicyDecision::DidReceivePolicyDecision):
3750         (Messages::WebPage::DidReceivePolicyDecision::arguments const):
3751         (Messages::WebPage::Close::name):
3752         (Messages::WebPage::Close::arguments const):
3753         (Messages::WebPage::PreferencesDidChange::name):
3754         (Messages::WebPage::PreferencesDidChange::PreferencesDidChange):
3755         (Messages::WebPage::PreferencesDidChange::arguments const):
3756         (Messages::WebPage::SendDoubleAndFloat::name):
3757         (Messages::WebPage::SendDoubleAndFloat::SendDoubleAndFloat):
3758         (Messages::WebPage::SendDoubleAndFloat::arguments const):
3759         (Messages::WebPage::SendInts::name):
3760         (Messages::WebPage::SendInts::SendInts):
3761         (Messages::WebPage::SendInts::arguments const):
3762         (Messages::WebPage::CreatePlugin::name):
3763         (Messages::WebPage::CreatePlugin::CreatePlugin):
3764         (Messages::WebPage::CreatePlugin::arguments const):
3765         (Messages::WebPage::RunJavaScriptAlert::name):
3766         (Messages::WebPage::RunJavaScriptAlert::RunJavaScriptAlert):
3767         (Messages::WebPage::RunJavaScriptAlert::arguments const):
3768         (Messages::WebPage::GetPlugins::name):
3769         (Messages::WebPage::GetPlugins::GetPlugins):
3770         (Messages::WebPage::GetPlugins::arguments const):
3771         (Messages::WebPage::GetPluginProcessConnection::name):
3772         (Messages::WebPage::GetPluginProcessConnection::GetPluginProcessConnection):
3773         (Messages::WebPage::GetPluginProcessConnection::arguments const):
3774         (Messages::WebPage::TestMultipleAttributes::name):
3775         (Messages::WebPage::TestMultipleAttributes::arguments const):
3776         (Messages::WebPage::TestParameterAttributes::name):
3777         (Messages::WebPage::TestParameterAttributes::TestParameterAttributes):
3778         (Messages::WebPage::TestParameterAttributes::arguments const):
3779         (Messages::WebPage::TemplateTest::name):
3780         (Messages::WebPage::TemplateTest::TemplateTest):
3781         (Messages::WebPage::TemplateTest::arguments const):
3782         (Messages::WebPage::SetVideoLayerID::name):
3783         (Messages::WebPage::SetVideoLayerID::SetVideoLayerID):
3784         (Messages::WebPage::SetVideoLayerID::arguments const):
3785         (Messages::WebPage::DidCreateWebProcessConnection::name):
3786         (Messages::WebPage::DidCreateWebProcessConnection::DidCreateWebProcessConnection):
3787         (Messages::WebPage::DidCreateWebProcessConnection::arguments const):
3788         (Messages::WebPage::InterpretKeyEvent::name):
3789         (Messages::WebPage::InterpretKeyEvent::InterpretKeyEvent):
3790         (Messages::WebPage::InterpretKeyEvent::arguments const):
3791         (Messages::WebPage::DeprecatedOperation::name):
3792         (Messages::WebPage::DeprecatedOperation::DeprecatedOperation):
3793         (Messages::WebPage::DeprecatedOperation::arguments const):
3794         (Messages::WebPage::ExperimentalOperation::name):
3795         (Messages::WebPage::ExperimentalOperation::ExperimentalOperation):
3796         (Messages::WebPage::ExperimentalOperation::arguments const):
3797         * Scripts/webkit/test-legacyMessagesReplies.h: Added.
3798         * Scripts/webkit/test-messages.in: Removed.
3799         * Scripts/webkit/test-superclass-messages.in: Removed.
3800         * Scripts/webkit/test-superclass.messages.in: Copied from Source/WebKit/Scripts/webkit/test-superclass-messages.in.
3801         * Scripts/webkit/test-superclassMessageReceiver.cpp: Added.
3802         (Messages::WebPage::TestAsyncMessage::callReply):
3803         (Messages::WebPage::TestAsyncMessage::cancelReply):
3804         (Messages::WebPage::TestAsyncMessage::send):
3805         (Messages::WebPage::TestAsyncMessageWithNoArguments::callReply):
3806         (Messages::WebPage::TestAsyncMessageWithNoArguments::cancelReply):
3807         (Messages::WebPage::TestAsyncMessageWithNoArguments::send):
3808         (Messages::WebPage::TestAsyncMessageWithMultipleArguments::callReply):
3809         (Messages::WebPage::TestAsyncMessageWithMultipleArguments::cancelReply):
3810         (Messages::WebPage::TestAsyncMessageWithMultipleArguments::send):
3811         (Messages::WebPage::TestSyncMessage::send):
3812         (Messages::WebPage::TestSynchronousMessage::send):
3813         (WebKit::WebPage::didReceiveMessage):
3814         (WebKit::WebPage::didReceiveSyncMessage):
3815         * Scripts/webkit/test-superclassMessages.h: Added.
3816         (Messages::WebPage::messageReceiverName):
3817         (Messages::WebPage::LoadURL::name):
3818         (Messages::WebPage::LoadURL::LoadURL):
3819         (Messages::WebPage::LoadURL::arguments const):
3820         (Messages::WebPage::TestAsyncMessage::name):
3821         (Messages::WebPage::TestAsyncMessage::asyncMessageReplyName):
3822         (Messages::WebPage::TestAsyncMessage::TestAsyncMessage):
3823         (Messages::WebPage::TestAsyncMessage::arguments const):
3824         (Messages::WebPage::TestAsyncMessageWithNoArguments::name):
3825         (Messages::WebPage::TestAsyncMessageWithNoArguments::asyncMessageReplyName):
3826         (Messages::WebPage::TestAsyncMessageWithNoArguments::arguments const):
3827         (Messages::WebPage::TestAsyncMessageWithMultipleArguments::name):
3828         (Messages::WebPage::TestAsyncMessageWithMultipleArguments::asyncMessageReplyName):
3829         (Messages::WebPage::TestAsyncMessageWithMultipleArguments::arguments const):
3830         (Messages::WebPage::TestSyncMessage::name):
3831         (Messages::WebPage::TestSyncMessage::TestSyncMessage):
3832         (Messages::WebPage::TestSyncMessage::arguments const):
3833         (Messages::WebPage::TestSynchronousMessage::name):
3834         (Messages::WebPage::TestSynchronousMessage::TestSynchronousMessage):
3835         (Messages::WebPage::TestSynchronousMessage::arguments const):
3836         * Scripts/webkit/test-superclassMessagesReplies.h: Added.
3837         * Scripts/webkit/test.messages.in: Added.
3838         * Scripts/webkit/testMessageReceiver.cpp: Added.
3839         * Scripts/webkit/testMessages.h: Added.
3840         (Messages::None::messageReceiverName):
3841         * Scripts/webkit/testMessagesReplies.h: Added.
3842         * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
3843         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
3844         (WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy):
3845         (WebKit::WebPaymentCoordinatorProxy::~WebPaymentCoordinatorProxy):
3846         * Shared/AuxiliaryProcess.cpp:
3847         (WebKit::AuxiliaryProcess::addMessageReceiver):
3848         (WebKit::AuxiliaryProcess::removeMessageReceiver):
3849         (WebKit::AuxiliaryProcess::didReceiveInvalidMessage):
3850         * Shared/AuxiliaryProcess.h:
3851         (WebKit::AuxiliaryProcess::addMessageReceiver):
3852         (WebKit::AuxiliaryProcess::removeMessageReceiver):
3853         * Shared/Cocoa/AuxiliaryProcessCocoa.mm:
3854         (WebKit::AuxiliaryProcess::didReceiveInvalidMessage):
3855         * SourcesCocoa.txt:
3856         * UIProcess/AuxiliaryProcessProxy.cpp:
3857         (WebKit::AuxiliaryProcessProxy::addMessageReceiver):
3858         (WebKit::AuxiliaryProcessProxy::removeMessageReceiver):
3859         (WebKit::AuxiliaryProcessProxy::logInvalidMessage):
3860         * UIProcess/AuxiliaryProcessProxy.h:
3861         (WebKit::AuxiliaryProcessProxy::addMessageReceiver):
3862         (WebKit::AuxiliaryProcessProxy::removeMessageReceiver):
3863         (WebKit::AuxiliaryProcessProxy::send):
3864         (WebKit::AuxiliaryProcessProxy::sendWithAsyncReply):
3865         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
3866         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
3867         (WebKit::WebPageProxy::paymentCoordinatorAddMessageReceiver): Deleted.
3868         (WebKit::WebPageProxy::paymentCoordinatorRemoveMessageReceiver): Deleted.
3869         * UIProcess/GPU/GPUProcessProxy.cpp:
3870         (WebKit::GPUProcessProxy::didReceiveInvalidMessage):
3871         * UIProcess/GPU/GPUProcessProxy.h:
3872         * UIProcess/Network/NetworkProcessProxy.cpp:
3873         (WebKit::NetworkProcessProxy::didReceiveInvalidMessage):
3874         * UIProcess/Network/NetworkProcessProxy.h:
3875         * UIProcess/Plugins/PluginProcessProxy.cpp:
3876         (WebKit::PluginProcessProxy::didReceiveInvalidMessage):
3877         * UIProcess/Plugins/PluginProcessProxy.h:
3878         * UIProcess/ProvisionalPageProxy.cpp:
3879         (WebKit::ProvisionalPageProxy::didReceiveMessage):
3880         * UIProcess/SuspendedPageProxy.cpp:
3881         (WebKit::messageNamesToIgnoreWhileSuspended):
3882         (WebKit::SuspendedPageProxy::didReceiveMessage):
3883         * UIProcess/WebPageProxy.h:
3884         * UIProcess/WebProcessPool.cpp:
3885         (WebKit::WebProcessPool::didReceiveInvalidMessage):
3886         (WebKit::WebProcessPool::addMessageReceiver):
3887         (WebKit::WebProcessPool::removeMessageReceiver):
3888         * UIProcess/WebProcessPool.h:
3889         * UIProcess/WebProcessProxy.cpp:
3890         (WebKit::WebProcessProxy::shouldSendPendingMessage):
3891         (WebKit::WebProcessProxy::didReceiveInvalidMessage):
3892         * UIProcess/WebProcessProxy.h:
3893         * WebProcess/GPU/GPUProcessConnection.cpp:
3894         (WebKit::GPUProcessConnection::didReceiveInvalidMessage):
3895         * WebProcess/GPU/GPUProcessConnection.h:
3896         * WebProcess/Inspector/WebInspector.h:
3897         * WebProcess/Inspector/WebInspectorUI.h:
3898         * WebProcess/Network/NetworkProcessConnection.cpp:
3899         (WebKit::NetworkProcessConnection::didReceiveInvalidMessage):
3900         * WebProcess/Network/NetworkProcessConnection.h:
3901         * WebProcess/Plugins/PluginProcessConnection.cpp:
3902         (WebKit::PluginProcessConnection::didReceiveInvalidMessage):
3903         * WebProcess/Plugins/PluginProcessConnection.h:
3904         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
3905         (WebKit::RemoteLayerTreeDrawingArea::updateRendering):
3906         * WebProcess/WebProcess.cpp:
3907         (WebKit::WebProcess::didReceiveMessage):
3908
3909 2020-05-06  Chris Dumez  <cdumez@apple.com>
3910
3911         REGRESSION (r260684): Reader background is lost after multitasking
3912         https://bugs.webkit.org/show_bug.cgi?id=211533
3913         <rdar://problem/62941837>
3914
3915         Unreviewed, revert r260684 due to regression.
3916
3917         * UIProcess/WebPageProxy.cpp:
3918         (WebKit::WebPageProxy::setShouldFireResizeEvents):
3919         * UIProcess/WebPageProxy.h:
3920         * UIProcess/ios/WKApplicationStateTrackingView.mm:
3921         (-[WKApplicationStateTrackingView _willBeginSnapshotSequence]):
3922         (-[WKApplicationStateTrackingView _didCompleteSnapshotSequence]):
3923         * WebProcess/WebPage/WebPage.cpp:
3924         (WebKit::WebPage::setShouldFireResizeEvents):
3925         * WebProcess/WebPage/WebPage.h:
3926         * WebProcess/WebPage/WebPage.messages.in:
3927
3928 2020-05-06  Kate Cheney  <katherine_cheney@apple.com>
3929
3930         ResourceLoadStatistics data summary call should create a web process pool if one doesn't exist
3931         https://bugs.webkit.org/show_bug.cgi?id=211520
3932         <rdar://problem/59869619>
3933
3934         Reviewed by Chris Dumez.
3935
3936         Ensures that a process pool and network process exist when requesting
3937         resource load statistics data.
3938
3939         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3940         (WebKit::WebsiteDataStore::getResourceLoadStatisticsDataSummary):
3941
3942 2020-05-06  Keith Rollin  <krollin@apple.com>
3943
3944         Better surfacing of the presenting parent PID in the Network process
3945         https://bugs.webkit.org/show_bug.cgi?id=211495
3946         <rdar://problem/62917205>
3947
3948         Reviewed by Youenn Fablet.
3949
3950         In Bug 205295, NetworkResourceLoader logging was improved, with one of
3951         the changes being that the PID of parent process that invoked the
3952         Network process was logged at the start of
3953         NetworkResourceLoader::start(). However, there was an execution path
3954         that skipped calling start()
3955         (NetworkConnectionToWebProcess::scheduleResourceLoad ->
3956         NetworkResourceLoader::startWithServiceWorker ->
3957         serviceWorkerDidNotHandle -> restartNetworkLoad -> startNetworkLoad),
3958         and so the the logging would not show the parent PID. This logging is
3959         needed for diagnostic purposes, so tweak the logging a little bit more
3960         in order to ensure we emit it. In this change, logging is added to
3961         various loading-related NetworkConnectionToWebProcess entry points
3962         (not just scheduleResourceLoad) in order to (a) ensure we emit the
3963         logging we want and (b) to give a clearer picture of what operations
3964         are being invoked in the Network process.
3965
3966         No new tests -- no new or changed functionality.
3967
3968         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3969         (WebKit::NetworkConnectionToWebProcess::hasUploadStateChanged):
3970         (WebKit::NetworkConnectionToWebProcess::resolveBlobReferences):
3971         (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
3972         (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
3973         (WebKit::NetworkConnectionToWebProcess::loadPing):
3974         (WebKit::NetworkConnectionToWebProcess::preconnectTo):
3975         (WebKit::NetworkConnectionToWebProcess::serverToContextConnectionNoLongerNeeded):
3976         * NetworkProcess/NetworkResourceLoader.cpp:
3977         (WebKit::NetworkResourceLoader::start):
3978
3979 2020-05-06  Wenson Hsieh  <wenson_hsieh@apple.com>
3980
3981         Cut and paste from Google Doc to Notes in several (non-Latin) languages doesn't work