e653614a942e131754591dfb98f7e45d9a12db44
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-06-21  Brent Fulgham  <bfulgham@apple.com>
2
3         Adjust sandboxes based on seed feedback
4         https://bugs.webkit.org/show_bug.cgi?id=199119
5         <rdar://problem/50164879>
6
7         Reviewed by Geoffrey Garen.
8
9         Update our sandboxes to address test failures and bugs encountered during initial iOS 13 and
10         macOS Catalina testing.
11
12         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
13         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
14         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
15         * WebProcess/com.apple.WebProcess.sb.in:
16
17 2019-06-21  Jiewen Tan  <jiewen_tan@apple.com>
18
19         WebPageProxy::loadData should accept ShouldOpenExternalURLsPolicy
20         https://bugs.webkit.org/show_bug.cgi?id=199114
21         <rdar://problem/51671674>
22
23         Reviewed by Youenn Fablet.
24
25         This patch teaches WebPageProxy::loadData to accept ShouldOpenExternalURLsPolicy policy,
26         and then utilize it in RedirectSOAuthorizationSession. Therefore, the response loaded after
27         successful interceptions will be able to propagate the same policy from the last navigation
28         as it were continuous loading.
29
30         Besides the above, this patch also fixes some minor issues.
31
32         * Shared/LoadParameters.h:
33         * UIProcess/Cocoa/SOAuthorization/NavigationSOAuthorizationSession.mm:
34         (WebKit::NavigationSOAuthorizationSession::shouldStartInternal):
35         (WebKit::NavigationSOAuthorizationSession::webViewDidMoveToWindow):
36         * UIProcess/Cocoa/SOAuthorization/PopUpSOAuthorizationSession.h:
37         * UIProcess/Cocoa/SOAuthorization/PopUpSOAuthorizationSession.mm:
38         (WebKit::PopUpSOAuthorizationSession::completeInternal):
39         * UIProcess/Cocoa/SOAuthorization/RedirectSOAuthorizationSession.h:
40         * UIProcess/Cocoa/SOAuthorization/RedirectSOAuthorizationSession.mm:
41         (WebKit::shouldOpenExternalURLsPolicy):
42         (WebKit::RedirectSOAuthorizationSession::completeInternal):
43         * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.h:
44         * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm:
45         (WebKit::SOAuthorizationSession::complete):
46         * UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.h:
47         * UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.mm:
48         (WebKit::SubFrameSOAuthorizationSession::fallBackToWebPathInternal):
49         (WebKit::SubFrameSOAuthorizationSession::completeInternal):
50         (WebKit::SubFrameSOAuthorizationSession::loadDataToFrame):
51         (WebKit::SubFrameSOAuthorizationSession::postDidCancelMessageToParent):
52         * UIProcess/WebPageProxy.cpp:
53         (WebKit::WebPageProxy::loadRequestWithNavigationShared):
54         (WebKit::WebPageProxy::loadFile):
55         (WebKit::WebPageProxy::loadData):
56         (WebKit::WebPageProxy::loadDataWithNavigationShared):
57         * UIProcess/WebPageProxy.h:
58         * WebProcess/WebPage/WebPage.cpp:
59         (WebKit::WebPage::loadDataImpl):
60         (WebKit::WebPage::loadData):
61         * WebProcess/WebPage/WebPage.h:
62
63 2019-06-21  Tim Horton  <timothy_horton@apple.com>
64
65         WebKit context menu highlights include extra padding
66         https://bugs.webkit.org/show_bug.cgi?id=199080
67         <rdar://problem/51140126>
68
69         Reviewed by Dean Jackson.
70
71         * Shared/ios/InteractionInformationRequest.cpp:
72         (WebKit::InteractionInformationRequest::encode const):
73         (WebKit::InteractionInformationRequest::decode):
74         (WebKit::InteractionInformationRequest::isValidForRequest):
75         (WebKit::InteractionInformationRequest::isApproximatelyValidForRequest):
76         * Shared/ios/InteractionInformationRequest.h:
77         * UIProcess/ios/WKContentViewInteraction.mm:
78         (-[WKContentView gestureRecognizerShouldBegin:]):
79         (-[WKContentView positionInformationForActionSheetAssistant:]):
80         (-[WKContentView updatePositionInformationForActionSheetAssistant:]):
81         (-[WKContentView _contextMenuInteraction:configurationForMenuAtLocation:completion:]):
82         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
83         * WebProcess/WebPage/ios/WebPageIOS.mm:
84         (WebKit::linkIndicatorPositionInformation):
85         Disable the margin going forward, but leave it if we're using the legacy
86         API, because there is no way to add margin at the platform level with
87         the legacy API.
88
89         In the future we should always have no margin in our indicator, and just
90         apply it in whatever consumes the indicator, so that there is no
91         disagreement between clients about the size of the margin.
92
93 2019-06-21  Youenn Fablet  <youenn@apple.com>
94
95         WebPageProxy should use the right path for sandbox extension
96         https://bugs.webkit.org/show_bug.cgi?id=198902
97         <rdar://problem/50772810>
98
99         Reviewed by Geoffrey Garen.
100
101         Store the sandbox path, if any, in UIProcess for each page in its PageLoadState.
102         This allows proper sandbox handling for reload after crash and process swap cases.
103         Store the sandbox path, if any, in the b/w list so that the sandbox path can be properly computed
104         during b/f navigation works.
105
106         Add SPI for test purposes to check what is the current sandbox path.
107
108         * Shared/WebBackForwardListItem.h:
109         (WebKit::WebBackForwardListItem::resourceDirectoryURL const):
110         (WebKit::WebBackForwardListItem::setResourceDirectoryURL):
111         * UIProcess/API/Cocoa/WKWebView.mm:
112         (-[WKWebView _resourceDirectoryURL]):
113         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
114         * UIProcess/PageLoadState.cpp:
115         (WebKit::PageLoadState::resourceDirectoryURL const):
116         (WebKit::PageLoadState::setPendingAPIRequestURL):
117         * UIProcess/PageLoadState.h:
118         (WebKit::PageLoadState::setPendingAPIRequestURL):
119         * UIProcess/WebPageProxy.cpp:
120         (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
121         (WebKit::WebPageProxy::loadRequestWithNavigationShared):
122         (WebKit::WebPageProxy::loadFile):
123         (WebKit::WebPageProxy::reload):
124         (WebKit::WebPageProxy::backForwardAddItem):
125         (WebKit::WebPageProxy::backForwardGoToItemShared):
126         (WebKit::WebPageProxy::currentResourceDirectoryURL const):
127         * UIProcess/WebPageProxy.h:
128
129 2019-06-21  Antoine Quint  <graouts@apple.com>
130
131         [iOS] Compatibility mouse events aren't prevented by calling preventDefault() on pointerdown
132         https://bugs.webkit.org/show_bug.cgi?id=198124
133         <rdar://problem/50410863>
134
135         Reviewed by Dean Jackson.
136
137         Ensure we wait until completion of a tap before removing the pointer ID and the preventDefault() state along with it.
138
139         * UIProcess/ios/WKContentViewInteraction.h:
140         * UIProcess/ios/WKContentViewInteraction.mm:
141         (-[WKContentView _singleTapDidReset:]):
142         (-[WKContentView _commitPotentialTapFailed]):
143         (-[WKContentView _didCompleteSyntheticClick]):
144         (-[WKContentView _singleTapRecognized:]):
145
146 2019-06-21  Keith Rollin  <krollin@apple.com>
147
148         Address reference to UIColor.groupTableViewBackgroundColor in WKPasswordView.mm
149         https://bugs.webkit.org/show_bug.cgi?id=199111
150         <rdar://problem/51992107>
151
152         Reviewed by Timothy Hatcher.
153
154         WKPasswordView.mm is used on iOS-family devices. However, it doesn't
155         build on tvOS or watchOS when "treat deprecation warnings as errors"
156         is enabled. This build failure is due to a reference to
157         UIColor.groupTableViewBackgroundColor in a branch of non-dark-mode
158         code. Address this by surrounding the reference with
159         ALLOW_DEPRECATED_DECLARATIONS_* macros.
160
161         Attempting to address the build failure by unconditionally enabling
162         the dark-mode code works for tvOS, but fails for watchOS due to lack
163         of dark-mode support on that platform.
164
165         * UIProcess/ios/WKPasswordView.mm:
166         (-[WKPasswordView showInScrollView:]):
167
168 2019-06-21  Michael Catanzaro  <mcatanzaro@igalia.com>
169
170         [WPE][GTK] Bump minimum versions of GLib, GTK, libsoup, ATK, GStreamer, and Cairo
171         https://bugs.webkit.org/show_bug.cgi?id=199094
172
173         Reviewed by Carlos Garcia Campos.
174
175         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
176         (WebKit::NetworkDataTaskSoup::createRequest):
177         (WebKit::NetworkDataTaskSoup::writeDownloadCallback):
178         (WebKit::NetworkDataTaskSoup::writeDownload):
179         (WebKit::NetworkDataTaskSoup::startingCallback):
180         (WebKit::NetworkDataTaskSoup::requestStartedCallback): Deleted.
181         * Shared/gtk/WebEventFactory.cpp:
182         (WebKit::buttonForEvent):
183         (WebKit::WebEventFactory::createWebMouseEvent):
184         (WebKit::WebEventFactory::createWebWheelEvent):
185         (WebKit::WebEventFactory::createWebKeyboardEvent):
186         (WebKit::WebEventFactory::createWebTouchEvent):
187         * UIProcess/API/gtk/PageClientImpl.cpp:
188         (WebKit::PageClientImpl::doneWithTouchEvent):
189         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
190         (ClickCounter::currentClickCountForGdkButtonEvent):
191         (webkitWebViewBaseRealize):
192         (webkitWebViewBaseHandleMouseEvent):
193         (webkitWebViewBaseGetTouchPointsForEvent):
194         (webkitWebViewBaseTouchEvent):
195         (webkitWebViewBaseGestureController):
196         (webkitWebViewBaseEvent):
197         (deviceScaleFactorChanged):
198         (webkitWebViewBaseCreateWebPage):
199         (webkitWebViewBaseTakeViewSnapshot):
200         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
201         * UIProcess/API/gtk/WebKitWebViewDialog.cpp:
202         (webkitWebViewDialogDraw):
203         (webkitWebViewDialogConstructed):
204         (webkit_web_view_dialog_class_init):
205         * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
206         (fileChooserDialogResponseCallback):
207         (webkitWebViewRunFileChooser):
208         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
209         (WebKit::doMouseEvent):
210         (WebKit::doMotionEvent):
211         (WebKit::doKeyStrokeEvent):
212         * UIProcess/WebPageProxy.h:
213         * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
214         (WebKit::AcceleratedBackingStoreWayland::~AcceleratedBackingStoreWayland):
215         (WebKit::AcceleratedBackingStoreWayland::tryEnsureGLContext):
216         (WebKit::AcceleratedBackingStoreWayland::makeContextCurrent):
217         (WebKit::AcceleratedBackingStoreWayland::paint):
218         * UIProcess/gtk/AcceleratedBackingStoreWayland.h:
219         * UIProcess/gtk/DragAndDropHandler.cpp:
220         (WebKit::DragAndDropHandler::startDrag):
221         (WebKit::DragAndDropHandler::fillDragData):
222         (WebKit::DragAndDropHandler::finishDrag):
223         * UIProcess/gtk/DragAndDropHandler.h:
224         * UIProcess/gtk/GestureController.cpp:
225         (WebKit::GestureController::handleEvent):
226         * UIProcess/gtk/GestureController.h:
227         * UIProcess/gtk/InputMethodFilter.cpp:
228         (WebKit::InputMethodFilter::filterKeyEvent):
229         (WebKit::InputMethodFilter::logHandleKeyboardEventForTesting):
230         (WebKit::InputMethodFilter::logHandleKeyboardEventWithCompositionResultsForTesting):
231         * UIProcess/gtk/ViewGestureControllerGtk.cpp:
232         (WebKit::isEventStop):
233         (WebKit::createScrollEvent):
234         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
235         (WebKit::WebContextMenuProxyGtk::append):
236         (WebKit::WebContextMenuProxyGtk::WebContextMenuProxyGtk):
237         (WebKit::WebContextMenuProxyGtk::~WebContextMenuProxyGtk):
238         * UIProcess/gtk/WebKitInspectorWindow.cpp:
239         (webkit_inspector_window_init):
240         (webkitInspectorWindowSetSubtitle):
241         * UIProcess/gtk/WebPageProxyGtk.cpp:
242         (WebKit::WebPageProxy::getCenterForZoomGesture):
243         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
244         (WebKit::WebPopupMenuProxyGtk::showPopupMenu):
245         (WebKit::WebPopupMenuProxyGtk::hidePopupMenu):
246         * WebProcess/WebPage/WebPage.h:
247         * WebProcess/WebPage/WebPage.messages.in:
248         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
249         (WebKit::WebPage::getCenterForZoomGesture):
250
251 2019-06-20  Patrick Griffis  <pgriffis@igalia.com> and Carlos Garcia Campos  <cgarcia@igalia.com>
252
253         [GTK][WPE] Implement a basic DNS cache
254         https://bugs.webkit.org/show_bug.cgi?id=196094
255
256         Reviewed by Michael Catanzaro.
257
258         This adds a simple cache to all DNS operations in the network process.
259
260         * NetworkProcess/glib/DNSCache.cpp: Added.
261         (WebKit::DNSCache::DNSCache):
262         (WebKit::DNSCache::mapForType):
263         (WebKit::DNSCache::lookup):
264         (WebKit::DNSCache::update):
265         (WebKit::DNSCache::removeExpiredResponsesInMap):
266         (WebKit::DNSCache::pruneResponsesInMap):
267         (WebKit::DNSCache::removeExpiredResponsesFired):
268         (WebKit::DNSCache::clear):
269         * NetworkProcess/glib/DNSCache.h: Added.
270         * NetworkProcess/glib/WebKitCachedResolver.cpp: Added.
271         (addressListVectorToGList):
272         (addressListGListToVector):
273         (webkitCachedResolverLookupByName):
274         (webkitCachedResolverLookupByNameAsync):
275         (webkitCachedResolverLookupByNameFinish):
276         (dnsCacheType):
277         (webkitCachedResolverLookupByNameWithFlags):
278         (webkitCachedResolverLookupByNameWithFlagsAsync):
279         (webkitCachedResolverLookupByNameWithFlagsFinish):
280         (webkitCachedResolverLookupByAddress):
281         (webkitCachedResolverLookupByAddressAsync):
282         (webkitCachedResolverLookupByAddressFinish):
283         (webkitCachedResolverLookupRecords):
284         (webkitCachedResolverLookupRecordsAsync):
285         (webkitCachedResolverLookupRecordsFinish):
286         (webkitCachedResolverReload):
287         (webkit_cached_resolver_class_init):
288         (webkitCachedResolverNew):
289         * NetworkProcess/glib/WebKitCachedResolver.h: Added.
290         * NetworkProcess/soup/NetworkProcessSoup.cpp:
291         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
292         * PlatformGTK.cmake:
293         * PlatformWPE.cmake:
294         * SourcesGTK.txt:
295         * SourcesWPE.txt:
296
297 2019-06-20  Carlos Garcia Campos  <cgarcia@igalia.com>
298
299         [GTK] Stop pretending WebCore::Widget can have a platform widget
300         https://bugs.webkit.org/show_bug.cgi?id=199066
301
302         Reviewed by Michael Catanzaro.
303
304         Rename PlatformWidget as PlatformViewWidget to avoid conflict with PlatformWidget defined in WebCore.
305
306         * UIProcess/WebPageProxy.h:
307         * UIProcess/win/WebPageProxyWin.cpp:
308         (WebKit::WebPageProxy::viewWidget):
309
310 2019-06-20  Megan Gardner  <megan_gardner@apple.com>
311
312         Remove change that was causing hangs
313         https://bugs.webkit.org/show_bug.cgi?id=199055
314         <rdar://problem/51820516>
315
316         Reviewed by Darin Adler.
317
318         This fix can sometimes cause deadlocks in the UIProcess.
319         We have a different fix that will go into UIKit <rdar://problem/51927701>.
320
321         * UIProcess/ios/WKContentViewInteraction.mm:
322         (-[WKContentView _selectionChanged]):
323
324 2019-06-20  Daniel Bates  <dabates@apple.com>
325
326         [iOS] Evernote crashes when creating a note
327         https://bugs.webkit.org/show_bug.cgi?id=199083
328         <rdar://problem/51759247>
329
330         Reviewed by Brent Fulgham.
331
332         Add a hack just for Evernote linked before iOS 13 that dynamically adds a placeholder -[WKContentView keyCommands]
333         method (it just calls super). Evernote swizzles the IPI -[WKContentView keyCommands], but this
334         method may not always be present in the WebKit binary following r240514. So, Evernote may end
335         up swizzling -[UIResponder keyCommands], but their implementation doesn't account for this
336         scenario and they end up crashing because they call an unrecognized selector.
337
338         * UIProcess/Cocoa/VersionChecks.h: Add version check.
339         * UIProcess/ios/WKContentView.mm:
340         (keyCommandsPlaceholderHackForEvernote): Added.
341         (-[WKContentView _commonInitializationWithProcessPool:configuration:]): Install the hack.
342
343 2019-06-20  Brady Eidson  <beidson@apple.com>
344
345         WebURLSchemeHandlerProxy::loadSynchronously crash with sync request.
346         <rdar://problem/51862206> and https://bugs.webkit.org/show_bug.cgi?id=199063
347
348         Reviewed by Geoffrey Garen.
349
350         Don't use a DataReference for the sync reply type.
351
352         * UIProcess/WebPageProxy.messages.in:
353         * UIProcess/WebURLSchemeHandler.h:
354
355         * UIProcess/WebURLSchemeTask.cpp:
356         (WebKit::WebURLSchemeTask::didComplete):
357         * UIProcess/WebURLSchemeTask.h:
358
359         * WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp:
360         (WebKit::WebURLSchemeHandlerProxy::loadSynchronously):
361
362 2019-06-20  Alex Christensen  <achristensen@webkit.org>
363
364         Add unit test for UIContextMenuConfiguration API
365         https://bugs.webkit.org/show_bug.cgi?id=199043
366
367         Reviewed by Wenson Hsieh.
368
369         * UIProcess/API/APIPageConfiguration.cpp:
370         (API::PageConfiguration::copy const):
371         * UIProcess/API/APIPageConfiguration.h:
372         (API::PageConfiguration::clickInteractionDriverForTesting const):
373         (API::PageConfiguration::setClickInteractionDriverForTesting):
374         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
375         (-[WKWebViewConfiguration _setClickInteractionDriverForTesting:]):
376         (-[WKWebViewConfiguration _clickInteractionDriverForTesting]):
377         * UIProcess/ios/WKContentViewInteraction.mm:
378         (-[WKContentView _registerPreview]):
379
380 2019-06-20  Alexander Mikhaylenko  <exalm7659@gmail.com>
381
382         [GTK] Enable navigation swipe layout tests
383         https://bugs.webkit.org/show_bug.cgi?id=198995
384
385         Reviewed by Michael Catanzaro.
386
387         Implement API for enabling and controlling swipes from WebKitTestRunner.
388
389         Implement beginSimulatedSwipeInDirectionForTesting() and completeSimulatedSwipeInDirectionForTesting()
390         in ViewGestureController for controlling the test swipes. Add functions in WebKitWebViewBase for calling
391         them.
392
393         Simulate the gesture by generating two scroll events: one to begin the gesture and one to complete it.
394
395         Since there's no reliable way to set source device type of the generated events to touchpad, don't check
396         source device type for simulated swipes.
397
398         * UIProcess/API/C/gtk/WKView.cpp:
399         (WKViewSetEnableBackForwardNavigationGesture): Added.
400         (WKViewBeginBackSwipeForTesting): Added.
401         (WKViewCompleteBackSwipeForTesting): Added.
402         * UIProcess/API/C/gtk/WKViewPrivate.h:
403         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
404         (webkitWebViewBaseBeginBackSwipeForTesting): Added.
405         (webkitWebViewBaseCompleteBackSwipeForTesting): Added.
406         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
407         * UIProcess/ViewGestureController.h:
408         * UIProcess/gtk/ViewGestureControllerGtk.cpp:
409         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanInfluenceSwipe):
410         Skip source device type check for simulated swipes. Also, remove an incorrect FIXME.
411         (WebKit::createScrollEvent): Added.
412         (WebKit::ViewGestureController::beginSimulatedSwipeInDirectionForTesting): Implemented.
413         (WebKit::ViewGestureController::completeSimulatedSwipeInDirectionForTesting): Implemented.
414
415 2019-06-20  Charlie Turner  <cturner@igalia.com>
416
417         [GTK] Make startup pause available in DEVELOPER_MODE rather than DEBUG.
418         https://bugs.webkit.org/show_bug.cgi?id=199069
419
420         Reviewed by Michael Catanzaro.
421
422         * WebProcess/gtk/WebProcessMainGtk.cpp: Allow developers to pause
423         the web process in DEVELOPER_MODE rather than only DEBUG, matching
424         the WPE behaviour and also the purpose of DEVELOPER_MODE.
425
426 2019-06-20  Alexander Mikhaylenko  <exalm7659@gmail.com>
427
428         [GTK] The Previous/Next gesture should handle RTL
429         https://bugs.webkit.org/show_bug.cgi?id=198707
430
431         Reviewed by Michael Catanzaro.
432
433         The gesture uses PageClientImpl::userInterfaceLayoutDirection() to determine the text
434         direction. Implement that method, then adjust drawing so that the pages move from/to
435         the left instead of right side for RTL locales.
436
437         * UIProcess/API/gtk/PageClientImpl.cpp:
438         (WebKit::): Implemented.
439         * UIProcess/API/gtk/PageClientImpl.h:
440         * UIProcess/gtk/ViewGestureControllerGtk.cpp:
441         (WebKit::ViewGestureController::draw):
442
443 2019-06-20  Carlos Garcia Campos  <cgarcia@igalia.com>
444
445         [GTK] Remove support for GTK2 plugins
446         https://bugs.webkit.org/show_bug.cgi?id=199065
447
448         Reviewed by Sergio Villar Senin.
449
450         * PlatformGTK.cmake:
451         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
452         (WebKit::moduleMixesGtkSymbols):
453         * Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp:
454         (WebKit::NetscapePluginModule::getPluginInfo):
455         * Shared/Plugins/PluginModuleInfo.h:
456         * Shared/gtk/WebEventFactory.cpp:
457         (WebKit::isGdkKeyCodeFromKeyPad):
458         (WebKit::buttonForEvent):
459         (WebKit::WebEventFactory::createWebMouseEvent):
460         (WebKit::WebEventFactory::createWebWheelEvent):
461         (WebKit::WebEventFactory::createWebKeyboardEvent):
462         (WebKit::WebEventFactory::createWebTouchEvent):
463         * SourcesGTK.txt:
464         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
465         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
466         (WebKit::ProcessLauncher::launchProcess):
467         * UIProcess/Plugins/PluginProcessProxy.h:
468         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
469         (WebKit::PluginInfoCache::getPluginInfo):
470         (WebKit::PluginInfoCache::updatePluginInfo):
471         * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
472         (WebKit::PluginInfoStore::getPluginInfo):
473         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
474         (WebKit::PluginProcessProxy::platformGetLaunchOptionsWithAttributes):
475         (WebKit::PluginProcessProxy::scanPlugin):
476         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
477
478 2019-06-19  Dean Jackson  <dino@apple.com>
479
480         No menu pop-up when long pressing on a link in Firefox app
481         https://bugs.webkit.org/show_bug.cgi?id=199045
482         <rdar://problem/51422407>
483
484         Reviewed by Tim Horton.
485
486         Add a version check for linking on-or-after iOS 13. When
487         that isn't true, we don't use UIContextMenuInteraction
488         and instead fall back on the legacy UIPreviewItem API.
489
490         * UIProcess/Cocoa/VersionChecks.h: Add FirstThatHasUIContextMenuInteraction.
491         * UIProcess/ios/WKContentViewInteraction.h: 
492         * UIProcess/ios/WKContentViewInteraction.mm:
493         (-[WKContentView _shouldUseContextMenus]): New method to decide if we should
494         use context menus or preview items.
495         (-[WKContentView setupInteraction]): Make the decision at runtime rather than
496         compile time.
497         (-[WKContentView _contentsOfUserInterfaceItem:]): Ditto.
498         (-[WKContentView _registerPreview]): Ditto.
499         (-[WKContentView _unregisterPreview]): Ditto.
500
501 2019-06-19  Andy Estes  <aestes@apple.com>
502
503         [iOS] Fall back to taking a UIView snapshohot for UITargetedPreviews if InteractionInformationAtPosition does not have an image
504         https://bugs.webkit.org/show_bug.cgi?id=199038
505         <rdar://problem/50555810>
506
507         Reviewed by Tim Horton.
508
509         In -contextMenuInteraction:previewForHighlightingMenuWithConfiguration: and friend, we
510         should always return a non-nil UITargetedPreview. When we do return nil, UIKit uses the web
511         view itself as the snapshot view, creating an unsightly animation.
512
513         For cases where we fail to create a UITargetedPreview from the information in
514         InteractionInformationAtPosition, this patch falls back to creating a UITargetedPreview with
515         a snapshot view obtained from
516         -[UIView resizableSnapshotViewFromRect:afterScreenUpdates:withCapInsets:].
517
518         Also renamed -targetedPreview to -_ensureTargetedPreview and cached the UITargetedPreview
519         for reuse in -contextMenuInteraction:previewForDismissingMenuWithConfiguration:.
520
521         * UIProcess/ios/WKContentViewInteraction.h:
522         * UIProcess/ios/WKContentViewInteraction.mm:
523         (createFallbackTargetedPreview):
524         (-[WKContentView _ensureTargetedPreview]):
525         (-[WKContentView contextMenuInteraction:previewForHighlightingMenuWithConfiguration:]):
526         (-[WKContentView contextMenuInteraction:previewForDismissingMenuWithConfiguration:]):
527         (-[WKContentView contextMenuInteractionDidEnd:]):
528         (-[WKContentView _targetedPreview]): Renamed to _ensureTargetedPreview.
529
530 2019-06-19  Devin Rousso  <drousso@apple.com>
531
532         Web Inspector: Network: replace CFNetwork SPI with new API where able
533         https://bugs.webkit.org/show_bug.cgi?id=198762
534
535         Reviewed by Timothy Hatcher.
536
537         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
538         (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
539
540 2019-06-19  Alex Christensen  <achristensen@webkit.org>
541
542         DownloadMonitor::measuredThroughputRate should approach zero with no throughput
543         https://bugs.webkit.org/show_bug.cgi?id=198981
544         <rdar://problem/51456914>
545
546         Reviewed by Geoffrey Garen.
547
548         When the timer fires to approximate the download rate, add a new timestamp with 0 bytes received since the last time we received bytes.
549         Then, if there's only one timestamp, assume the throughput rate is 0 instead of infinite.
550         This will prevent false positives estimating large download rates based on old data when the throughput drops to 0.
551
552         * NetworkProcess/Downloads/DownloadMonitor.cpp:
553         (WebKit::DownloadMonitor::measuredThroughputRate const):
554         (WebKit::DownloadMonitor::timerFired):
555
556 2019-06-19  Sihui Liu  <sihui_liu@apple.com>
557
558         Remove unused originsWithCredentials from WebsiteData
559         https://bugs.webkit.org/show_bug.cgi?id=199020
560
561         Reviewed by Geoffrey Garen.
562
563         * Shared/WebsiteData/WebsiteData.cpp:
564         (WebKit::WebsiteData::encode const):
565         (WebKit::WebsiteData::decode):
566         * Shared/WebsiteData/WebsiteData.h:
567
568 2019-06-19  Sihui Liu  <sihui_liu@apple.com>
569
570         Crash at com.apple.WebKit: WebKit::WebsiteDataStore::processPools const
571         https://bugs.webkit.org/show_bug.cgi?id=198935
572         <rdar://problem/51549308>
573
574         Reviewed by Geoffrey Garen.
575
576         When WebProcessProxy is in WebProcessCache or is pre-warmed, it does not hold a strong reference of 
577         WebProcessPool. In this case, we should not store the raw pointer of WebProcessPool and perform websiteDataStore
578         operations with it.
579         This patch should fix the crash at dereferencing null pointer of WebProcessPool in 
580         WebsiteDataStore::processPools, but it is unclear why websiteDataStore comes to observe cached or prewarmed web 
581         process that should not have web page. The release log may help us find the cause.
582
583         * UIProcess/WebProcessProxy.cpp:
584         (WebKit::WebProcessProxy::processPoolIfExists const):
585         * UIProcess/WebProcessProxy.h:
586         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
587         (WebKit::WebsiteDataStore::processPools const):
588
589 2019-06-19  Alex Christensen  <achristensen@webkit.org>
590
591         Add a unit test for client certificate authentication
592         https://bugs.webkit.org/show_bug.cgi?id=197800
593
594         Reviewed by Youenn Fablet.
595
596         * Shared/cf/ArgumentCodersCF.cpp:
597         Move SPI declarations to SecuritySPI.h.
598
599 2019-06-19  Alex Christensen  <achristensen@webkit.org>
600
601         Update preview API deprecation message.
602         https://bugs.webkit.org/show_bug.cgi?id=198974
603
604         * UIProcess/API/Cocoa/WKUIDelegate.h:
605
606 2019-06-19  Adrian Perez de Castro  <aperez@igalia.com>
607
608         [GTK] Fix compilation errors for the GTK2 plugin process
609         https://bugs.webkit.org/show_bug.cgi?id=199000
610
611         Reviewed by Michael Catanzaro.
612
613         * Shared/gtk/WebEventFactory.cpp: Use the GdkEvent union fields
614         when directly accessing event struct fields.
615         (WebKit::buttonForEvent):
616         (WebKit::WebEventFactory::createWebMouseEvent):
617         (WebKit::WebEventFactory::createWebKeyboardEvent):
618
619 2019-06-19  Adrian Perez de Castro  <aperez@igalia.com>
620
621         [WPE][GTK] Fix build with unified sources disabled
622         https://bugs.webkit.org/show_bug.cgi?id=198752
623
624         Reviewed by Michael Catanzaro.
625
626         * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
627         (WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker): Qualify SQLiteDatabase
628         with its namespace.
629         * UIProcess/WebFrameProxy.h: Replace forward declaration of WebPageProxy with inclusion
630         of WebPageProxy.h to avoid build error due to usage of undefined class. Moved DataCallback
631         definition from WebPageProxy.h to avoid code using the type before its declaration.
632         * UIProcess/WebPageProxy.h: Remove definition of DataCallback.
633         * UIProcess/wpe/WebInspectorProxyWPE.cpp: Add missing forward declaration of
634         WebCore::FloatRect.
635         (WebKit::WebInspectorProxy::platformSetSheetRect): Qualify FloatRect with its namespace.
636         * WebProcess/Automation/WebAutomationSessionProxy.cpp: Qualify all occurrences of
637         PageIdentifier with its namespace.
638         (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction):
639         (WebKit::WebAutomationSessionProxy::resolveChildFrameWithOrdinal):
640         (WebKit::WebAutomationSessionProxy::resolveChildFrameWithNodeHandle):
641         (WebKit::WebAutomationSessionProxy::resolveChildFrameWithName):
642         (WebKit::WebAutomationSessionProxy::resolveParentFrame):
643         (WebKit::WebAutomationSessionProxy::focusFrame):
644         (WebKit::WebAutomationSessionProxy::computeElementLayout):
645         (WebKit::WebAutomationSessionProxy::selectOptionElement):
646         (WebKit::WebAutomationSessionProxy::takeScreenshot):
647         (WebKit::WebAutomationSessionProxy::getCookiesForFrame):
648         (WebKit::WebAutomationSessionProxy::deleteCookie):
649         * WebProcess/Cache/WebCacheStorageConnection.cpp: Ditto.
650         (WebKit::WebCacheStorageConnection::open):
651         (WebKit::WebCacheStorageConnection::remove):
652         (WebKit::WebCacheStorageConnection::retrieveCaches):
653         (WebKit::WebCacheStorageConnection::retrieveRecords):
654         (WebKit::WebCacheStorageConnection::batchDeleteOperation):
655         (WebKit::WebCacheStorageConnection::batchPutOperation):
656         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp: Add missing inclusion of WebPage.h
657         * WebProcess/WebPage/gtk/WebPageGtk.cpp: Add missing inclusion of gtk/gtk.h
658         * WebProcess/WebPage/wpe/WebPageWPE.cpp: Add missing inclusion of WebPageProxy.h
659
660 2019-06-19  Alexander Mikhaylenko  <exalm7659@gmail.com>
661
662         [GTK] Page blinks after navigation swipe if it triggered PSON
663         https://bugs.webkit.org/show_bug.cgi?id=198996
664
665         Reviewed by Michael Catanzaro.
666
667         Disconnect and then reconnect ViewGestureController during process swap
668         instead of destroying and re-creating it.
669
670         * UIProcess/API/gtk/PageClientImpl.cpp:
671         (WebKit::PageClientImpl::PageClientImpl::processWillSwap): Added.
672         (WebKit::PageClientImpl::PageClientImpl::processDidExit): Implemented.
673         * UIProcess/API/gtk/PageClientImpl.h:
674         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
675         (webkitWebViewBaseWillSwapWebProcess): Added.
676         Disconnect ViewGestureController if it exists.
677         (webkitWebViewBaseDidExitWebProcess): Added.
678         Destroy ViewGestureController.
679         (webkitWebViewBaseDidRelaunchWebProcess):
680         Reconnect the ViewGestureController if it exists.
681         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
682
683 2019-06-19  Takashi Komori  <Takashi.Komori@sony.com>
684
685         [Curl] CurlRequestScheduler doesn't terminate worker thread in a certain situation.
686         https://bugs.webkit.org/show_bug.cgi?id=198993
687
688         Cancel CurlRequest before invalidation to remove tasks from CurlRequestScheduler certainly in ~NetworkDataTaskCurl.
689
690         Reviewed by Fujii Hironori.
691
692         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
693         (WebKit::NetworkDataTaskCurl::~NetworkDataTaskCurl):
694
695 2019-06-19  Zan Dobersek  <zdobersek@igalia.com>
696
697         [Nicosia] Invalidate SceneIntegration in LayerTreeHost::invalidate()
698         https://bugs.webkit.org/show_bug.cgi?id=198992
699
700         Reviewed by Carlos Garcia Campos.
701
702         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
703         (WebKit::LayerTreeHost::invalidate): Invalidate the
704         Nicosia::SceneIntegration object. This should properly disassociate
705         the now-invalited LayerTreeHost (a SceneIntegration client) from the
706         SceneIntegration object that can still be shared with platform layers
707         originating from this LayerTreeHost.
708
709 2019-06-18  Dean Jackson  <dino@apple.com>
710
711         UIContextMenuInteraction implementation for WKContentView
712         https://bugs.webkit.org/show_bug.cgi?id=198986
713         <rdar://problem/51875189>
714
715         Reviewed by Andy Estes.
716
717         Implement UIContextMenuInteraction and its delegate as a
718         replacement for UIPreviewItemController in iOS 13.
719
720         In order to preserve existing behaviour as much as possible,
721         we check for the implementation of new WebKit API to configure
722         the menu. If that is not present, we attempt to convert
723         the results of the existing WebKit WKPreviewAction delegates
724         into something that works with UIContextMenus.
725
726         * UIProcess/ios/WKContentViewInteraction.h:
727         * UIProcess/ios/WKContentViewInteraction.mm:
728         (-[WKContentView setupInteraction]):
729         (-[WKContentView _contentsOfUserInterfaceItem:]):
730         (-[WKContentView _registerPreview]):
731         (-[WKContentView _unregisterPreview]):
732         (-[WKContentView _showLinkPreviewsPreferenceChanged:]):
733         (needsDeprecatedPreviewAPI):
734         (uiActionForPreviewAction):
735         (menuFromPreviewOrDefaults):
736         (titleForMenu):
737         (-[WKContentView assignLegacyDataForContextMenuInteraction]):
738         (-[WKContentView contextMenuInteraction:configurationForMenuAtLocation:]):
739         (-[WKContentView _contextMenuInteraction:configurationForMenuAtLocation:completion:]):
740         (-[WKContentView continueContextMenuInteraction:]):
741         (uiImageForImage):
742         (createTargetedPreview):
743         (-[WKContentView _targetedPreview]):
744         (-[WKContentView contextMenuInteraction:previewForHighlightingMenuWithConfiguration:]):
745         (-[WKContentView contextMenuInteractionWillPresent:]):
746         (-[WKContentView contextMenuInteraction:previewForDismissingMenuWithConfiguration:]):
747         (-[WKContentView contextMenuInteraction:willCommitWithAnimator:]):
748         (-[WKContentView contextMenuInteractionDidEnd:]):
749         (-[WKContentView shouldUsePreviewForLongPress]): Deleted.
750
751 2019-06-18  Ryan Haddad  <ryanhaddad@apple.com>
752
753         Unreviewed, rolling out r246575.
754
755         Breaks internal builds.
756
757         Reverted changeset:
758
759         "Update WebKit API to separately retrieve actions and use
760         context menus"
761         https://bugs.webkit.org/show_bug.cgi?id=198974
762         https://trac.webkit.org/changeset/246575
763
764 2019-06-18  Alex Christensen  <achristensen@webkit.org>
765
766         Update WebKit API to separately retrieve actions and use context menus
767         https://bugs.webkit.org/show_bug.cgi?id=198974
768         <rdar://problem/50735687>
769
770         Reviewed by Tim Horton.
771
772         Update API and SPI, and add infrastructure for asynchronously requesting interaction information.
773
774         * UIProcess/API/Cocoa/WKUIDelegate.h:
775         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
776
777 2019-06-18  Daniel Bates  <dabates@apple.com>
778
779         REGRESSION (r240757): Cannot dismiss the keyboard on http://apple.com/apple-tv-plus
780         https://bugs.webkit.org/show_bug.cgi?id=198922
781         <rdar://problem/50300056>
782
783         Reviewed by Wenson Hsieh.
784
785         Actually dismiss the keyboard as intended in r240757. Do not wait for the round-trip
786         to the WebProcess to run through the -elementDidBlur steps in the UIProcess and hide
787         the keyboard when a person explicitly dismisses the keyboard via the Done button (iPhone)
788         or hide keyboard button (iPad).
789
790         Note that r240757 revealed another bug in this code, <https://bugs.webkit.org/show_bug.cgi?id=198928>.
791         I am unclear of the implications of that bug, but it is clear for this bug that it
792         never makes sense to round-trip to the WebProcess when the keyboard is dismissed by
793         a user gesture.
794
795         * UIProcess/ios/WKContentViewInteraction.mm:
796         (-[WKContentView endEditingAndUpdateFocusAppearanceWithReason:]): Invoke -_elementDidBlur
797         to blur the element in the UIProcess and hide the keyboard.
798         (-[WKContentView _elementDidBlur]): Prevent duplicate invocations of -didEndFormControlInteraction
799         and setIsShowingInputViewForFocusedElement messages by only doing these actions when
800         editablity changes. This covers the case where -_elementDidBlur may be invoked a second
801         time (the reply in the round-trip). In that case we don't need to do these actions.
802
803 2019-06-18  Alex Christensen  <achristensen@webkit.org>
804
805         NetworkSession::networkStorageSession can return null
806         https://bugs.webkit.org/show_bug.cgi?id=198947
807         <rdar://problem/51394449>
808
809         Reviewed by Youenn Fablet.
810
811         We are seeing evidence of crashes from the map owning NetworkSessions and the map owning NetworkStorageSessions becoming out of sync
812         because NetworkSession is refcounted but NetworkStorageSession is not.  I started the complete fix in https://bugs.webkit.org/show_bug.cgi?id=194926
813         but for now let's add less risky null checks to prevent fallout.
814
815         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
816         (WebKit::ResourceLoadStatisticsStore::updateClientSideCookiesAgeCap):
817         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
818         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccessForFrame):
819         (WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
820         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
821         (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
822         (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCap):
823         (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler):
824         (WebKit::WebResourceLoadStatisticsStore::removePrevalentDomains):
825         * NetworkProcess/NetworkProcess.cpp:
826         (WebKit::NetworkProcess::initializeNetworkProcess):
827         * NetworkProcess/NetworkSession.cpp:
828         (WebKit::NetworkSession::networkStorageSession const):
829         * NetworkProcess/NetworkSession.h:
830         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
831         (WebKit::NetworkDataTaskCocoa::applyCookieBlockingPolicy):
832         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
833         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
834         (WebKit::NetworkDataTaskCocoa::tryPasswordBasedAuthentication):
835
836 2019-06-18  Brady Eidson  <beidson@apple.com>
837
838         Handle NSProgress calling our cancellation handler on background threads (and calling it more than once).
839         <rdar://problem/51392926> and https://bugs.webkit.org/show_bug.cgi?id=198945
840
841         Reviewed by Alex Christensen.
842
843         If you have a download in progress and quickly tap the button to cancel it multiple times, then:
844             - NSProgress calls our cancellation handler on a non-main thread, which we can't handle.
845             - They do it more than once, which is also bad.
846             - They might even do it multiple times concurrently (on different background dispatch queues)
847         
848         Let's work around these.
849
850         * NetworkProcess/Downloads/Download.cpp:
851         (WebKit::Download::cancel): Double check we're on the main thread, and handle being called twice.
852
853         * NetworkProcess/Downloads/cocoa/WKDownloadProgress.mm:
854         (-[WKDownloadProgress performCancel]): Actually cancel the WebKit::Download if we still have one.
855         (-[WKDownloadProgress progressCancelled]): Called when NSProgress calls the cancellation handler, no matter
856           which thread it does it on. By leveraging std::call_once we handle multiple calls as well as being called
857           concurrently from different threads. call_once punts the *actual* cancel operation off to the main thread.
858         (-[WKDownloadProgress initWithDownloadTask:download:URL:sandboxExtension:]): The cancellation handler is
859           now simply calling 'progressCancelled' on self, assuming the weak pointer for self is still valid.
860
861 2019-06-18  Daniel Bates  <dabates@apple.com>
862
863         [iOS] Pressing key while holding Command should not insert character
864         https://bugs.webkit.org/show_bug.cgi?id=198925
865         <rdar://problem/51778811>
866
867         Reviewed by Brent Fulgham.
868
869         Do not insert a character for an unhandled key command that has a Command modifier.
870         For example, pressing Command + Shift + v, which is an unhandled key command (at the
871         time of writing) should not insert v. This matches iOS and Mac platform conventions.
872
873         * UIProcess/ios/WKContentViewInteraction.mm:
874         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
875
876 2019-06-18  John Wilander  <wilander@apple.com>
877
878         Change log channel name from ResourceLoadStatisticsDebug to ITPDebug and remove unnecessary #if !RELEASE_LOG_DISABLED
879         https://bugs.webkit.org/show_bug.cgi?id=198970
880         <rdar://problem/51855836>
881
882         Reviewed by Brent Fulgham.
883
884         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
885         (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess):
886         (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccessUnderOpener):
887         (WebKit::ResourceLoadStatisticsDatabaseStore::ensurePrevalentResourcesForDebugMode):
888         (WebKit::ResourceLoadStatisticsDatabaseStore::updateCookieBlocking):
889         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
890         (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccess):
891         (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccessUnderOpener):
892         (WebKit::ResourceLoadStatisticsMemoryStore::ensurePrevalentResourcesForDebugMode):
893         (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking):
894         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
895         (WebKit::domainsToString):
896         (WebKit::ResourceLoadStatisticsStore::removeDataRecords):
897         (WebKit::ResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
898         (WebKit::ResourceLoadStatisticsStore::debugLogDomainsInBatches):
899         * Platform/Logging.h:
900
901 2019-06-18  Youenn Fablet  <youenn@apple.com>
902
903         StorageManager::removeAllowedSessionStorageNamespaceConnection should make sure its storageNamespaceID is valid
904         https://bugs.webkit.org/show_bug.cgi?id=198966
905         rdar://problem/51352080
906
907         Reviewed by Alex Christensen.
908
909         Make sure the namespace ID is a key of the map before using the value.
910         The namespace ID is coming straight from IPC so should not be trusted.
911         Also, namespace IDs are added/removed based on web pages being created/deleted.
912         Namespace IDs are supposed to be scoped by session IDs.
913         Using page IDs for namespace IDs works as long as the page does not change of session ID during its lifetime, which is not guaranteed.
914
915         * NetworkProcess/WebStorage/StorageManager.cpp:
916         (WebKit::StorageManager::removeAllowedSessionStorageNamespaceConnection):
917
918 2019-06-18  David Quesada  <david_quesada@apple.com>
919
920         Network process crash in SandboxExtension::consume() via Download::publishProgress
921         https://bugs.webkit.org/show_bug.cgi?id=198968
922         rdar://problem/51732997
923
924         Reviewed by Alex Christensen.
925
926         Add an early return if the network process fails to resolve a sandbox extension handle for publishing
927         progress on a download. Creating the NSProgress doesn't do much since the progress reporting service
928         won't honor the attempt to publish progress on a URL the process does not have access to, and nothing
929         else in the Network process makes any use of the progress.
930
931         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
932         (WebKit::Download::publishProgress):
933
934 2019-06-18  Adrian Perez de Castro  <aperez@igalia.com>
935
936         Unreviewed. Update OptionsWPE.cmake and NEWS for the 2.25.1 release
937
938         * wpe/NEWS: Add release notes for 2.25.1
939
940 2019-06-18  Tim Horton  <timothy_horton@apple.com>
941
942         Expose DataDetectors context generation on WKContentViewInteraction
943         https://bugs.webkit.org/show_bug.cgi?id=198950
944         <rdar://problem/51116021>
945
946         Reviewed by Andy Estes.
947
948         * UIProcess/ios/WKActionSheetAssistant.h:
949         * UIProcess/ios/WKActionSheetAssistant.mm:
950         (-[WKActionSheetAssistant currentPositionInformation]):
951         (-[WKActionSheetAssistant showDataDetectorsSheet]):
952         * UIProcess/ios/WKContentViewInteraction.h:
953         * UIProcess/ios/WKContentViewInteraction.mm:
954         (-[WKContentView dataDetectionContextForPositionInformation:]):
955         (-[WKContentView dataDetectionContextForActionSheetAssistant:]):
956         For use by other clients, add -dataDetectionContextForPositionInformation:
957         and make -dataDetectionContextForActionSheetAssistant: use it.
958         Also, pull the code to augment the context with surrounding text out of
959         from WKActionSheetAssistant.
960
961 2019-06-18  Adrian Perez de Castro  <aperez@igalia.com>
962
963         [WPE] Fix building the documentation
964
965         Unreviewed.
966
967         * UIProcess/API/wpe/docs/wpe-docs.sgml: Fix typo "2.62" -> "2.26"
968
969 2019-06-18  Truitt Savell  <tsavell@apple.com>
970
971         Unreviewed, rolling out r246531.
972
973         Broke internal builds.
974
975         Reverted changeset:
976
977         "Expose DataDetectors context generation on
978         WKContentViewInteraction"
979         https://bugs.webkit.org/show_bug.cgi?id=198950
980         https://trac.webkit.org/changeset/246531
981
982 2019-06-18  Simon Fraser  <simon.fraser@apple.com>
983
984         Convert macOS to scroll by changing layer boundsOrigin
985         https://bugs.webkit.org/show_bug.cgi?id=198917
986
987         Reviewed by Antti Koivisto.
988
989         Remove unreached and confusing code.
990
991         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
992         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::repositionScrollingLayers):
993
994 2019-06-18  Dean Jackson  <dino@apple.com>
995
996         Attachment elements are missing context menu previews
997         https://bugs.webkit.org/show_bug.cgi?id=198946
998
999         Reviewed by Tim Horton.
1000
1001         When requesting position information on an <attachment> element,
1002         we were not providing a snapshot image.
1003
1004         * WebProcess/WebPage/WebPage.h: New common method to take a snapshot.
1005         * WebProcess/WebPage/ios/WebPageIOS.mm:
1006         (WebKit::WebPage::shareableBitmapSnapshotForNode): New helper.
1007         (WebKit::WebPage::positionInformation): If the element is an attachment,
1008         then ask for a snapshot.
1009
1010 2019-06-17  Tim Horton  <timothy_horton@apple.com>
1011
1012         Expose DataDetectors context generation on WKContentViewInteraction
1013         https://bugs.webkit.org/show_bug.cgi?id=198950
1014         <rdar://problem/51116021>
1015
1016         Reviewed by Andy Estes.
1017
1018         * UIProcess/ios/WKActionSheetAssistant.h:
1019         * UIProcess/ios/WKActionSheetAssistant.mm:
1020         (-[WKActionSheetAssistant currentPositionInformation]):
1021         (-[WKActionSheetAssistant showDataDetectorsSheet]):
1022         * UIProcess/ios/WKContentViewInteraction.h:
1023         * UIProcess/ios/WKContentViewInteraction.mm:
1024         (-[WKContentView dataDetectionContextForPositionInformation:]):
1025         (-[WKContentView dataDetectionContextForActionSheetAssistant:]):
1026         For use by other clients, add -dataDetectionContextForPositionInformation:
1027         and make -dataDetectionContextForActionSheetAssistant: use it.
1028         Also, pull the code to augment the context with surrounding text out of
1029         from WKActionSheetAssistant.
1030
1031 2019-06-17  Sihui Liu  <sihui_liu@apple.com>
1032
1033         -[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:] doesn't delete _WKWebsiteDataTypeCredentials
1034         https://bugs.webkit.org/show_bug.cgi?id=198854
1035         <rdar://problem/51386058>
1036
1037         Reviewed by Geoffrey Garen.
1038
1039         Clear persistent credentials in deleteWebsiteData of network process.
1040
1041         Also, merge originsWithPersistentCredentials and removeCredentialsWithOrigins into fetchWebsiteData and
1042         deleteWebsiteData, and move credentials handling to WebCore.
1043
1044         * NetworkProcess/NetworkProcess.cpp:
1045         (WebKit::NetworkProcess::fetchWebsiteData):
1046         (WebKit::NetworkProcess::deleteWebsiteData):
1047         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
1048         (WebKit::NetworkProcess::originsWithPersistentCredentials): Deleted.
1049         (WebKit::NetworkProcess::removeCredentialsWithOrigins): Deleted.
1050         * NetworkProcess/NetworkProcess.h:
1051         * NetworkProcess/NetworkProcess.messages.in:
1052         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1053         (WebKit::NetworkProcess::originsWithPersistentCredentials): Deleted.
1054         (WebKit::NetworkProcess::removeCredentialsWithOrigins): Deleted.
1055         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1056         (WebKit::WebsiteDataStore::fetchDataAndApply):
1057         (WebKit::computeWebProcessAccessTypeForDataRemoval):
1058         (WebKit::WebsiteDataStore::removeData):
1059
1060 2019-06-17  Tim Horton  <timothy_horton@apple.com>
1061
1062         Fix the build with case-sensitive includes
1063         <rdar://problem/51828273>
1064
1065         * UIProcess/API/Cocoa/WKContentRuleListStore.mm:
1066         FileSystem, not Filesystem.
1067
1068 2019-06-17  Jiewen Tan  <jiewen_tan@apple.com>
1069
1070         Unreviewed, build fix after r246514
1071
1072         * UIProcess/Cocoa/SOAuthorization/SOAuthorizationNSURLExtras.h:
1073         * UIProcess/Cocoa/SOAuthorization/SOAuthorizationNSURLExtras.mm:
1074         (+[NSURL _web_canPerformAuthorizationWithURL:]):
1075         Expose the above method as a SPI for Safari.
1076         * WebKit.xcodeproj/project.pbxproj:
1077
1078 2019-06-17  Alex Christensen  <achristensen@webkit.org>
1079
1080         Protect StorageManager::m_localStorageNamespaces with a Lock
1081         https://bugs.webkit.org/show_bug.cgi?id=198939
1082         <rdar://problem/51784225>
1083
1084         Reviewed by Geoff Garen.
1085
1086         StorageManager::LocalStorageNamespace::didDestroyStorageArea is called from StorageArea::~StorageArea which is called on the main thread.
1087         All other access of m_localStorageNamespaces is from the non-main thread.  Sometimes this causes hash table corruption, so wait for a mutex
1088         before accessing this member variable.
1089
1090         * NetworkProcess/WebStorage/StorageManager.cpp:
1091         (WebKit::StorageManager::LocalStorageNamespace::didDestroyStorageArea):
1092         (WebKit::StorageManager::cloneSessionStorageNamespace):
1093         (WebKit::StorageManager::getLocalStorageOrigins):
1094         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin):
1095         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
1096         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
1097         (WebKit::StorageManager::getOrCreateLocalStorageNamespace):
1098         * NetworkProcess/WebStorage/StorageManager.h:
1099
1100 2019-06-17  Alex Christensen  <achristensen@webkit.org>
1101
1102         Add null check in WebFrameLoaderClient::assignIdentifierToInitialRequest
1103         https://bugs.webkit.org/show_bug.cgi?id=198926
1104         <rdar://problem/50079713>
1105
1106         Reviewed by Brady Eidson.
1107
1108         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1109         (WebKit::WebFrameLoaderClient::assignIdentifierToInitialRequest):
1110         WebKitLegacy's version already checks null for the corresponding call.
1111
1112 2019-06-17  Alex Christensen  <achristensen@webkit.org>
1113
1114         Fix internal build after r246514
1115         https://bugs.webkit.org/show_bug.cgi?id=198874
1116
1117         * UIProcess/API/APINavigationAction.h:
1118         A problematic reference to APINavigationActionAdditions.h was left.
1119         Its contents had been sprinkled into the correct places, though.
1120
1121 2019-06-17  Jiewen Tan  <jiewen_tan@apple.com>
1122
1123         Move SOAuthorization from WebKitAdditions to WebKit
1124         https://bugs.webkit.org/show_bug.cgi?id=198874
1125         <rdar://problem/47573431>
1126
1127         Reviewed by Brent Fulgham.
1128
1129         This patch basically moves everything from existing WebKitAdditions to WebKit.
1130         It also replaces the LoadOptimizer nonsense with the actual SOAuthorization API.
1131
1132         * Configurations/WebKit.xcconfig:
1133         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1134         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1135         * PluginProcess/mac/PluginProcessMac.mm:
1136         (WebKit::PluginProcess::platformInitializePluginProcess):
1137         * SourcesCocoa.txt:
1138         * UIProcess/API/APINavigationAction.h:
1139         * UIProcess/Cocoa/NavigationState.mm:
1140         (WebKit::trySOAuthorization):
1141         (WebKit::tryInterceptNavigation):
1142         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
1143         (WebKit::tryOptimizingLoad): Deleted.
1144         * UIProcess/Cocoa/SOAuthorization/NavigationSOAuthorizationSession.h: Added.
1145         (WebKit::NavigationSOAuthorizationSession::callback):
1146         * UIProcess/Cocoa/SOAuthorization/NavigationSOAuthorizationSession.mm: Copied from Tools/TestWebKitAPI/Tests/WebKitCocoa/TestLoadOptimizer.mm.
1147         (WebKit::NavigationSOAuthorizationSession::NavigationSOAuthorizationSession):
1148         (WebKit::NavigationSOAuthorizationSession::~NavigationSOAuthorizationSession):
1149         (WebKit::NavigationSOAuthorizationSession::shouldStartInternal):
1150         (WebKit::NavigationSOAuthorizationSession::webViewDidMoveToWindow):
1151         * UIProcess/Cocoa/SOAuthorization/PopUpSOAuthorizationSession.h: Added.
1152         * UIProcess/Cocoa/SOAuthorization/PopUpSOAuthorizationSession.mm: Added.
1153         (-[WKSOSecretDelegate initWithSession:]):
1154         (-[WKSOSecretDelegate webViewDidClose:]):
1155         (-[WKSOSecretDelegate webView:decidePolicyForNavigationAction:decisionHandler:]):
1156         (-[WKSOSecretDelegate webView:didFinishNavigation:]):
1157         (WebKit::PopUpSOAuthorizationSession::PopUpSOAuthorizationSession):
1158         (WebKit::PopUpSOAuthorizationSession::~PopUpSOAuthorizationSession):
1159         (WebKit::PopUpSOAuthorizationSession::shouldStartInternal):
1160         (WebKit::PopUpSOAuthorizationSession::fallBackToWebPathInternal):
1161         (WebKit::PopUpSOAuthorizationSession::abortInternal):
1162         (WebKit::PopUpSOAuthorizationSession::completeInternal):
1163         (WebKit::PopUpSOAuthorizationSession::close):
1164         (WebKit::PopUpSOAuthorizationSession::initSecretWebView):
1165         * UIProcess/Cocoa/SOAuthorization/RedirectSOAuthorizationSession.h: Copied from Tools/TestWebKitAPI/Tests/WebKitCocoa/TestLoadOptimizer.mm.
1166         * UIProcess/Cocoa/SOAuthorization/RedirectSOAuthorizationSession.mm: Added.
1167         (WebKit::RedirectSOAuthorizationSession::RedirectSOAuthorizationSession):
1168         (WebKit::RedirectSOAuthorizationSession::fallBackToWebPathInternal):
1169         (WebKit::RedirectSOAuthorizationSession::abortInternal):
1170         (WebKit::RedirectSOAuthorizationSession::completeInternal):
1171         (WebKit::RedirectSOAuthorizationSession::beforeStart):
1172         * UIProcess/Cocoa/SOAuthorization/SOAuthorizationCoordinator.h: Copied from Tools/TestWebKitAPI/Tests/WebKitCocoa/TestLoadOptimizer.mm.
1173         * UIProcess/Cocoa/SOAuthorization/SOAuthorizationCoordinator.mm: Added.
1174         (WebKit::SOAuthorizationCoordinator::SOAuthorizationCoordinator):
1175         (WebKit::SOAuthorizationCoordinator::canAuthorize const):
1176         (WebKit::SOAuthorizationCoordinator::tryAuthorize):
1177         * UIProcess/Cocoa/SOAuthorization/SOAuthorizationNSURLExtras.h: Copied from Tools/TestWebKitAPI/Tests/WebKitCocoa/TestLoadOptimizer.mm.
1178         * UIProcess/Cocoa/SOAuthorization/SOAuthorizationNSURLExtras.mm: Copied from Tools/TestWebKitAPI/Tests/WebKitCocoa/TestLoadOptimizer.mm.
1179         (+[NSURL _web_canPerformAuthorizationWithURL:]):
1180         * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.h: Added.
1181         (WebKit::SOAuthorizationSession::page const):
1182         (WebKit::SOAuthorizationSession::state const):
1183         (WebKit::SOAuthorizationSession::setState):
1184         (WebKit::SOAuthorizationSession::navigationAction):
1185         * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm: Added.
1186         (WebKit::SOAuthorizationSession::SOAuthorizationSession):
1187         (WebKit::SOAuthorizationSession::~SOAuthorizationSession):
1188         (WebKit::SOAuthorizationSession::releaseNavigationAction):
1189         (WebKit::SOAuthorizationSession::becomeCompleted):
1190         (WebKit::SOAuthorizationSession::shouldStart):
1191         (WebKit::SOAuthorizationSession::start):
1192         (WebKit::SOAuthorizationSession::fallBackToWebPath):
1193         (WebKit::SOAuthorizationSession::abort):
1194         (WebKit::SOAuthorizationSession::complete):
1195         (WebKit::SOAuthorizationSession::presentViewController):
1196         (WebKit::SOAuthorizationSession::dismissViewController):
1197         * UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.h: Copied from Tools/TestWebKitAPI/Tests/WebKitCocoa/TestLoadOptimizer.mm.
1198         * UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.mm: Added.
1199         (WebKit::SubFrameSOAuthorizationSession::SubFrameSOAuthorizationSession):
1200         (WebKit::SubFrameSOAuthorizationSession::fallBackToWebPathInternal):
1201         (WebKit::SubFrameSOAuthorizationSession::abortInternal):
1202         (WebKit::SubFrameSOAuthorizationSession::completeInternal):
1203         (WebKit::SubFrameSOAuthorizationSession::beforeStart):
1204         (WebKit::SubFrameSOAuthorizationSession::loadDataToFrame):
1205         (WebKit::SubFrameSOAuthorizationSession::postDidCancelMessageToParent):
1206         * UIProcess/Cocoa/SOAuthorization/WKSOAuthorizationDelegate.h: Renamed from Tools/TestWebKitAPI/Tests/WebKitCocoa/TestLoadOptimizer.mm.
1207         * UIProcess/Cocoa/SOAuthorization/WKSOAuthorizationDelegate.mm: Added.
1208         (-[WKSOAuthorizationDelegate authorization:presentViewController:withCompletion:]):
1209         (-[WKSOAuthorizationDelegate authorizationDidNotHandle:]):
1210         (-[WKSOAuthorizationDelegate authorizationDidCancel:]):
1211         (-[WKSOAuthorizationDelegate authorizationDidComplete:]):
1212         (-[WKSOAuthorizationDelegate authorization:didCompleteWithHTTPAuthorizationHeaders:]):
1213         (-[WKSOAuthorizationDelegate authorization:didCompleteWithHTTPResponse:httpBody:]):
1214         (-[WKSOAuthorizationDelegate authorization:didCompleteWithError:]):
1215         (-[WKSOAuthorizationDelegate setSession:]):
1216         * UIProcess/WebPageProxy.cpp:
1217         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1218         (WebKit::trySOAuthorization):
1219         (WebKit::WebPageProxy::createNewPage):
1220         (WebKit::tryOptimizingLoad): Deleted.
1221         * UIProcess/WebPageProxy.h:
1222         (WebKit::WebPageProxy::setShouldSuppressSOAuthorizationInAllNavigationPolicyDecision):
1223         (WebKit::WebPageProxy::setShouldSuppressSOAuthorizationInNextNavigationPolicyDecision):
1224         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1225         (WebKit::WebsiteDataStore::WebsiteDataStore):
1226         * UIProcess/WebsiteData/WebsiteDataStore.h:
1227         (WebKit::WebsiteDataStore::soAuthorizationCoordinator):
1228         * WebKit.xcodeproj/project.pbxproj:
1229         * WebProcess/cocoa/WebProcessCocoa.mm:
1230         (WebKit::WebProcess::platformInitializeProcess):
1231
1232 2019-06-17  Tim Horton  <timothy_horton@apple.com>
1233
1234         Fix the build.
1235
1236         * UIProcess/Gamepad/ios/UIGamepadProviderIOS.mm:
1237         (WebKit::UIGamepadProvider::platformWebPageProxyForGamepadInput):
1238         * UIProcess/_WKTouchEventGenerator.mm:
1239         (-[_WKTouchEventGenerator _sendHIDEvent:]):
1240         (-[_WKTouchEventGenerator _sendMarkerHIDEventWithCompletionBlock:]):
1241
1242 2019-06-17  Dan Bernstein  <mitz@apple.com>
1243
1244         REGRESSION (r242686): Paths in XPC services’ LC_DYLD_ENVIRONMENT are incorrect in built products directory
1245         https://bugs.webkit.org/show_bug.cgi?id=198904
1246
1247         Reviewed by Alex Christensen.
1248
1249         After r242686, in local builds, the XPC service executables run from their location at the
1250         top of the built products directory, rather than inside the framework.
1251
1252         * Configurations/BaseXPCService.xcconfig: Updated the load commands that set
1253           DYLD_FRAMEWORK_PATH and DYLD_LIBRARY_PATH for the new location in the built products
1254           directory. Also removed WK_XPC_SERVICE_INSERT_LIBRARIES_DIR that had been unused.
1255
1256         * WebKit.xcodeproj/project.pbxproj: Made the creation of symbolic links inside the
1257           framework’s XPCServices directory predicated on whether this is an install build, rather
1258           than on the build configuration, for consistency with the condition used in the .xcconfig.
1259
1260 2019-06-17  Brent Fulgham  <bfulgham@apple.com>
1261
1262         Ensure ITP state is relayed to Network Process on restart
1263         https://bugs.webkit.org/show_bug.cgi?id=198797
1264         <rdar://problem/51646944>
1265
1266         Reviewed by Youenn Fablet.
1267
1268         Now that the ITP state is maintained in the Network Process, we have to make sure that we update
1269         that process with current ITP state if the Network Process crashes and is relaunched. This wasn't a
1270         problem in earlier releases because we tracked all ITP state in the UIProcess.
1271
1272         This patch does the following:
1273         1. Add a new method to WKWebsiteDataStore to allow us to trigger statistics processing, which has the
1274            side effect of syncing ITP state persistently so that it will be available after bouncing the process.
1275         2. Adds a new test that sets a tracking domain, bounces the process, and confirms the state is still
1276            consistent.
1277
1278         Tested by TestWebKitAPI.
1279
1280         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
1281         (WebKit::ResourceLoadStatisticsStore::processStatisticsAndDataRecords):
1282         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1283         (-[WKWebsiteDataStore _clearPrevalentDomain:completionHandler:]):
1284         (-[WKWebsiteDataStore _processStatisticsAndDataRecords:]):
1285         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1286         * UIProcess/WebProcessPool.cpp:
1287         (WebKit::WebProcessPool::ensureNetworkProcess):
1288         (WebKit::WebProcessPool::setResourceLoadStatisticsEnabled):
1289         * UIProcess/WebProcessPool.h:
1290         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1291         (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
1292
1293 2019-06-17  Ludovico de Nittis  <ludovico.denittis@collabora.com>
1294
1295         [GTK] Stop accessing GdkEvent fields when possible
1296         https://bugs.webkit.org/show_bug.cgi?id=198829
1297
1298         Reviewed by Michael Catanzaro.
1299
1300         Direct access to GdkEvent structs is no longer possible in GTK 4.
1301
1302         * Shared/gtk/WebEventFactory.cpp:
1303         (WebKit::buttonForEvent):
1304         (WebKit::WebEventFactory::createWebMouseEvent):
1305         (WebKit::WebEventFactory::createWebWheelEvent):
1306         (WebKit::WebEventFactory::createWebKeyboardEvent):
1307         (WebKit::WebEventFactory::createWebTouchEvent):
1308         * UIProcess/API/gtk/WebKitEmojiChooser.cpp:
1309         * UIProcess/API/gtk/WebKitScriptDialogImpl.cpp:
1310         (webkitScriptDialogImplKeyPressEvent):
1311         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1312         (ClickCounter::currentClickCountForGdkButtonEvent):
1313         (webkitWebViewBaseKeyPressEvent):
1314         (webkitWebViewBaseHandleMouseEvent):
1315         (webkitWebViewBaseCrossingNotifyEvent):
1316         (webkitWebViewBaseGetTouchPointsForEvent):
1317         (webkitWebViewBaseTouchEvent):
1318         (webkitWebViewBaseEvent):
1319         * UIProcess/gtk/GestureController.cpp:
1320         (WebKit::GestureController::handleEvent):
1321         * UIProcess/gtk/InputMethodFilter.cpp:
1322         (WebKit::InputMethodFilter::filterKeyEvent):
1323         (WebKit::InputMethodFilter::logHandleKeyboardEventForTesting):
1324         (WebKit::InputMethodFilter::logHandleKeyboardEventWithCompositionResultsForTesting):
1325         * UIProcess/gtk/KeyBindingTranslator.cpp:
1326         (WebKit::KeyBindingTranslator::commandsForKeyEvent):
1327         * UIProcess/gtk/ViewGestureControllerGtk.cpp:
1328         (WebKit::isEventStop):
1329         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanInfluenceSwipe):
1330         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventGetScrollingDeltas):
1331         (WebKit::ViewGestureController::SwipeProgressTracker::handleEvent):
1332         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
1333         (WebKit::WebPopupMenuProxyGtk::treeViewButtonReleaseEventCallback):
1334         (WebKit::WebPopupMenuProxyGtk::keyPressEventCallback):
1335
1336 2019-06-17  Carlos Garcia Campos  <cgarcia@igalia.com>
1337
1338         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.25.2 release
1339
1340         * gtk/NEWS: Add release notes for 2.25.2.
1341
1342 2019-06-17  Carlos Garcia Campos  <cgarcia@igalia.com>
1343
1344         Unreviewed, rolling out r246467.
1345
1346         It broke scrolling with mouse wheel
1347
1348         Reverted changeset:
1349
1350         "[GTK] Stop accessing GdkEvent fields when possible"
1351         https://bugs.webkit.org/show_bug.cgi?id=198829
1352         https://trac.webkit.org/changeset/246467
1353
1354 2019-06-16  Darin Adler  <darin@apple.com>
1355
1356         Rename AtomicString to AtomString
1357         https://bugs.webkit.org/show_bug.cgi?id=195276
1358
1359         Reviewed by Michael Catanzaro.
1360
1361         * many files: Let do-webcore-rename do the renaming.
1362
1363 2019-06-16  Simon Fraser  <simon.fraser@apple.com>
1364
1365         Implement ScrollableArea::scrollOffset()
1366         https://bugs.webkit.org/show_bug.cgi?id=198895
1367
1368         Reviewed by Antti Koivisto.
1369
1370         * UIProcess/win/WebPopupMenuProxyWin.cpp:
1371         (WebKit::PopupMenuWin::scrollPosition const):
1372         (WebKit::WebPopupMenuProxyWin::onKeyDown): Just use m_scrollOffset.
1373         (WebKit::WebPopupMenuProxyWin::scrollSize const): Deleted.
1374         * UIProcess/win/WebPopupMenuProxyWin.h: Remove the one-axis scrollOffset()
1375         * WebProcess/Plugins/PDF/PDFPlugin.h:
1376         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1377         (WebKit::PDFPlugin::scrollSize const): Deleted.
1378         (WebKit::PDFPlugin::scrollOffset const): Deleted.
1379         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
1380         (WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
1381
1382 2019-06-15  Youenn Fablet  <youenn@apple.com>
1383
1384         WebProcessPool::clearWebProcessHasUploads cannot assume its given processIdentifier is valid
1385         https://bugs.webkit.org/show_bug.cgi?id=198865
1386
1387         Unreviewed.
1388
1389         * UIProcess/WebProcessPool.cpp:
1390         (WebKit::WebProcessPool::clearWebProcessHasUploads):
1391         Remove wrong debug assertion in case of WebProcessProxy destruction.
1392
1393 2019-06-15  Ludovico de Nittis  <ludovico.denittis@collabora.com>
1394
1395         [GTK] Stop accessing GdkEvent fields when possible
1396         https://bugs.webkit.org/show_bug.cgi?id=198829
1397
1398         Reviewed by Michael Catanzaro.
1399
1400         Direct access to GdkEvent structs is no longer possible in GTK 4.
1401
1402         * Shared/gtk/WebEventFactory.cpp:
1403         (WebKit::buttonForEvent):
1404         (WebKit::WebEventFactory::createWebMouseEvent):
1405         (WebKit::WebEventFactory::createWebWheelEvent):
1406         (WebKit::WebEventFactory::createWebKeyboardEvent):
1407         (WebKit::WebEventFactory::createWebTouchEvent):
1408         * UIProcess/API/gtk/WebKitEmojiChooser.cpp:
1409         * UIProcess/API/gtk/WebKitScriptDialogImpl.cpp:
1410         (webkitScriptDialogImplKeyPressEvent):
1411         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1412         (ClickCounter::currentClickCountForGdkButtonEvent):
1413         (webkitWebViewBaseKeyPressEvent):
1414         (webkitWebViewBaseHandleMouseEvent):
1415         (webkitWebViewBaseCrossingNotifyEvent):
1416         (webkitWebViewBaseGetTouchPointsForEvent):
1417         (webkitWebViewBaseTouchEvent):
1418         (webkitWebViewBaseEvent):
1419         * UIProcess/gtk/GestureController.cpp:
1420         (WebKit::GestureController::handleEvent):
1421         * UIProcess/gtk/InputMethodFilter.cpp:
1422         (WebKit::InputMethodFilter::filterKeyEvent):
1423         (WebKit::InputMethodFilter::logHandleKeyboardEventForTesting):
1424         (WebKit::InputMethodFilter::logHandleKeyboardEventWithCompositionResultsForTesting):
1425         * UIProcess/gtk/KeyBindingTranslator.cpp:
1426         (WebKit::KeyBindingTranslator::commandsForKeyEvent):
1427         * UIProcess/gtk/ViewGestureControllerGtk.cpp:
1428         (WebKit::isEventStop):
1429         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanInfluenceSwipe):
1430         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventGetScrollingDeltas):
1431         (WebKit::ViewGestureController::SwipeProgressTracker::handleEvent):
1432         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
1433         (WebKit::WebPopupMenuProxyGtk::treeViewButtonReleaseEventCallback):
1434         (WebKit::WebPopupMenuProxyGtk::keyPressEventCallback):
1435
1436 2019-06-15  Rob Buis  <rbuis@igalia.com>
1437
1438         Store prefetch redirects in the prefetch cache
1439         https://bugs.webkit.org/show_bug.cgi?id=197371
1440
1441         Reviewed by Youenn Fablet.
1442
1443         Store prefetch redirects in the prefetch cache and use them when
1444         navigating.
1445
1446         * NetworkProcess/NetworkResourceLoader.cpp:
1447         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
1448         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
1449         (WebKit::NetworkResourceLoader::didFinishWithRedirectResponse):
1450         * NetworkProcess/NetworkResourceLoader.h:
1451         * NetworkProcess/cache/PrefetchCache.cpp:
1452         (WebKit::PrefetchCache::Entry::Entry):
1453         (WebKit::PrefetchCache::storeRedirect):
1454         * NetworkProcess/cache/PrefetchCache.h:
1455
1456 2019-06-14  Devin Rousso  <drousso@apple.com>
1457
1458         waitForNavigationToComplete may be called before WebPageProxy knows it's loading
1459         https://bugs.webkit.org/show_bug.cgi?id=198741
1460         <rdar://problem/31164316>
1461
1462         Reviewed by Joseph Pecoraro.
1463
1464         There's a potential race in `WebAutomationSession::waitForNavigationToCompleteOnPage` when
1465         querying for the `WebPageProxy`'s loading state (via `PageLoadingState::isLoading`), in that
1466         a pending load may be committed _after_ the `WebAutomationSession` checks it's value. This
1467         makes the automation session think that it isn't loading, so it will continue running
1468         commands, which can lead to a JavaScript error ("Callback was not called before the unload
1469         event") as any injected scripts will be cleared by the impending navigation, leaving the
1470         script evaluation callbacks "dangling".
1471
1472         Expose more information from `PageLoadState` about whether it thinks there _may_ be a
1473         navigation currently happening, which the `WebAutomationSession` can use to delay commands.
1474
1475         In the best case, no navigations are "missed".
1476
1477         In the worst case, the automation session will wait `pageLoadTimeout` before continuing.
1478
1479         * UIProcess/Automation/WebAutomationSession.cpp:
1480         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage):
1481
1482         * UIProcess/PageLoadState.h:
1483         * UIProcess/PageLoadState.cpp:
1484         (WebKit::PageLoadState::hasUncommittedLoad const): Added.
1485
1486 2019-06-14  Youenn Fablet  <youenn@apple.com>
1487
1488         WebProcessPool::clearWebProcessHasUploads cannot assume its given processIdentifier is valid
1489         https://bugs.webkit.org/show_bug.cgi?id=198865
1490         <rdar://problem/51618878>
1491
1492         Reviewed by Brady Eidson.
1493
1494         NetworkProcess currently instructs UIProcess whether a given WebProcess is doing upload.
1495         There is no guarantee though that the WebProcessProxy is still there when the IPC is arriving at UIProcess.
1496         Instead, let WebProcess handles its upload state and notify WebProcessPool about its state.
1497         Make sure WebProcessProxy unregisters itself in case of crash.
1498         In case of NetworkProcess crash, WebProcesses will see all their uploads fail
1499         and will notify automatically UIProcess to update their state.
1500
1501         Since the processID given to WebProcessPool is coming from IPC, we cannot not trust it.
1502         Add early return in case of not finding a WebProcessProxy for WebProcessPool clear/set methods.
1503
1504         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1505         (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
1506         * NetworkProcess/NetworkConnectionToWebProcess.h:
1507         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1508         * NetworkProcess/NetworkResourceLoadMap.cpp:
1509         (WebKit::NetworkResourceLoadMap::add):
1510         (WebKit::NetworkResourceLoadMap::take):
1511         * NetworkProcess/NetworkResourceLoadMap.h:
1512         * UIProcess/WebProcessPool.cpp:
1513         (WebKit::WebProcessPool::setWebProcessHasUploads):
1514         (WebKit::WebProcessPool::clearWebProcessHasUploads):
1515         * UIProcess/WebProcessProxy.cpp:
1516         (WebKit::WebProcessProxy::~WebProcessProxy):
1517         * WebProcess/Network/WebLoaderStrategy.cpp:
1518         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
1519         (WebKit::WebLoaderStrategy::remove):
1520         (WebKit::WebLoaderStrategy::tryLoadingSynchronouslyUsingURLSchemeHandler):
1521         * WebProcess/Network/WebLoaderStrategy.h:
1522         * WebProcess/WebProcess.cpp:
1523         (WebKit::WebProcess::ensureNetworkProcessConnection):
1524
1525 2019-06-14  Youenn Fablet  <youenn@apple.com>
1526
1527         WebResourceLoadStatisticsStore should not use its network session if invalidated
1528         https://bugs.webkit.org/show_bug.cgi?id=198814
1529
1530         Reviewed by Geoffrey Garen.
1531
1532         Tell WebResourceLoadStatisticsStore that its network session is invalidated.
1533         WebResourceLoadStatisticsStore will then clear its reference to the network session.
1534
1535         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
1536         (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking):
1537         Added for test purposes to trigger further cookie processing.
1538         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
1539         (WebKit::WebResourceLoadStatisticsStore::invalidateAndCancel):
1540         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
1541         * NetworkProcess/NetworkSession.cpp:
1542         (WebKit::NetworkSession::invalidateAndCancel):
1543
1544 2019-06-14  Joseph Pecoraro  <pecoraro@apple.com>
1545
1546         [Cocoa] NSFileWrapper associated with _WKAttachment
1547         https://bugs.webkit.org/show_bug.cgi?id=198871
1548         <rdar://problem/51760625>
1549
1550         Reviewed by Wenson Hsieh.
1551
1552         * UIProcess/API/Cocoa/_WKAttachment.mm:
1553         (-[_WKAttachment dealloc]):
1554         Ensure we destruct the API::Object associated with this so RetainPtrs can release.
1555
1556 2019-06-14  Tim Horton  <timothy_horton@apple.com>
1557
1558         WebKit's NSAttributedString.h is not included in the WebKit.h umbrella header
1559         https://bugs.webkit.org/show_bug.cgi?id=198869
1560         <rdar://problem/51754437>
1561
1562         Reviewed by Timothy Hatcher.
1563
1564         * Shared/API/Cocoa/WebKit.h:
1565         Make the new API available to modularized clients and folks who just import WebKit.h
1566
1567 2019-06-14  Jiewen Tan  <jiewen_tan@apple.com>
1568
1569         Disable AppSSO for web processes and plugin processes
1570         https://bugs.webkit.org/show_bug.cgi?id=198843
1571         <rdar://problem/51642920>
1572
1573         Reviewed by Sam Weinig.
1574
1575         This patch moves the disabling of AppSSO from AuxiliaryProcess to PluginProcess
1576         and WebProcess such that NetworkingProcess will not be affected.
1577
1578         * PluginProcess/mac/PluginProcessMac.mm:
1579         (WebKit::PluginProcess::platformInitializePluginProcess):
1580         * Shared/ios/AuxiliaryProcessIOS.mm:
1581         (WebKit::AuxiliaryProcess::platformInitialize):
1582         * Shared/mac/AuxiliaryProcessMac.mm:
1583         (WebKit::AuxiliaryProcess::platformInitialize):
1584         * WebProcess/cocoa/WebProcessCocoa.mm:
1585         (WebKit::WebProcess::platformInitializeProcess):
1586
1587 2019-06-14  Megan Gardner  <megan_gardner@apple.com>
1588
1589         Move Synthetic Editing Commands to behind an experimental feature flag
1590         https://bugs.webkit.org/show_bug.cgi?id=198842
1591         <rdar://problem/50594700>
1592
1593         Reviewed by Simon Fraser.
1594
1595         Add a feature flag to gate synthetic editing commands.
1596
1597         * Shared/WebPreferences.yaml:
1598         * WebProcess/WebPage/ios/WebPageIOS.mm:
1599         (WebKit::WebPage::getFocusedElementInformation):
1600
1601 2019-06-13  Megan Gardner  <megan_gardner@apple.com>
1602
1603         Fix selection hang in Mail
1604         https://bugs.webkit.org/show_bug.cgi?id=198845
1605         <rdar://problem/51388180>
1606
1607         Reviewed by Tim Horton.
1608
1609         SelectionDidChange requires a selectionWillChange in order to keep things in line.
1610
1611         * UIProcess/ios/WKContentViewInteraction.mm:
1612         (-[WKContentView _selectionChanged]):
1613
1614 2019-06-13  Tim Horton  <timothy_horton@apple.com>
1615
1616         No content shows up for WKWebView while locked even with _canShowWhileLocked is YES
1617         https://bugs.webkit.org/show_bug.cgi?id=198819
1618         <rdar://problem/51636240>
1619
1620         Reviewed by Simon Fraser.
1621
1622         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
1623         (WebKit::WebPageProxy::didCreateContextForVisibilityPropagation):
1624         * UIProcess/WebPageProxy.h:
1625         (WebKit::WebPageProxy::contextIDForVisibilityPropagation const):
1626         * UIProcess/WebPageProxy.messages.in:
1627         * UIProcess/WebProcessProxy.h:
1628         (WebKit::WebProcessProxy::contextIDForVisibilityPropagation): Deleted.
1629         * UIProcess/WebProcessProxy.messages.in:
1630         * UIProcess/ios/WKContentView.mm:
1631         (-[WKContentView _setupVisibilityPropagationView]):
1632         * UIProcess/ios/WebPageProxyIOS.mm:
1633         (WebKit::WebPageProxy::didCreateContextForVisibilityPropagation): Deleted.
1634         * UIProcess/ios/WebProcessProxyIOS.mm:
1635         (WebKit::WebProcessProxy::didCreateContextForVisibilityPropagation): Deleted.
1636         * WebProcess/WebPage/WebPage.cpp:
1637         (WebKit::m_shrinkToFitContentTimer):
1638         * WebProcess/WebPage/WebPage.h:
1639         * WebProcess/WebProcess.h:
1640         * WebProcess/cocoa/WebProcessCocoa.mm:
1641         (WebKit::WebProcess::platformInitializeWebProcess):
1642         Move the creation of the visibility propagation context to WebPage instead of WebProcess,
1643         because canShowWhileLocked is per-page, not per-process.
1644
1645         Also, pass canShowWhileLocked into the context creation function for the visibility
1646         propagation context, not just RemoteLayerTree contexts.
1647
1648 2019-06-13  Antoine Quint  <graouts@apple.com>
1649
1650         "display: contents" Content click does not trigger
1651         https://bugs.webkit.org/show_bug.cgi?id=198559
1652         <rdar://problem/51488524>
1653
1654         Reviewed by Antti Koivisto.
1655
1656         * WebProcess/WebPage/ios/WebPageIOS.mm:
1657         (WebKit::WebPage::commitPotentialTap):
1658
1659 2019-06-13  Takashi Komori  <Takashi.Komori@sony.com>
1660
1661         [curl] Remove member objects of CurlRequest not to share by different threads.
1662         https://bugs.webkit.org/show_bug.cgi?id=198747
1663
1664         Reviewed by Fujii Hironori.
1665
1666         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
1667         (WebKit::NetworkDataTaskCurl::curlDidReceiveResponse):
1668         (WebKit::NetworkDataTaskCurl::curlDidComplete):
1669         (WebKit::NetworkDataTaskCurl::curlDidFailWithError):
1670         * NetworkProcess/curl/NetworkDataTaskCurl.h:
1671
1672 2019-06-13  Zan Dobersek  <zdobersek@igalia.com>
1673
1674         [Nicosia] Add SceneIntegration
1675         https://bugs.webkit.org/show_bug.cgi?id=198791
1676
1677         Reviewed by Carlos Garcia Campos.
1678
1679         Have the LayerTreeHost own the SceneIntegration object that's to be
1680         associated with layers used inside the LayerTreeHost's scene. The
1681         class now also inherits the SceneIntegration::Client interface, with the
1682         requestUpdate() method scheduling a scene update in ThreadedCompositor.
1683
1684         CompositingCoordinator now retrieves the SceneIntegration object from
1685         the LayerTreeHost instance and manages association to that object for
1686         layers under the coordinator's control.
1687
1688         ThreadedCompositor class gets a new public updateScene() method that
1689         schedules an update, enabling the SceneIntegration class to invoke
1690         scene updates.
1691
1692         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1693         (WebKit::ThreadedCompositor::updateScene):
1694         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1695         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1696         (WebKit::CompositingCoordinator::createGraphicsLayer):
1697         (WebKit::CompositingCoordinator::detachLayer):
1698         (WebKit::CompositingCoordinator::attachLayer):
1699         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
1700         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
1701         (WebKit::LayerTreeHost::LayerTreeHost):
1702         (WebKit::LayerTreeHost::sceneIntegration):
1703         (WebKit::LayerTreeHost::requestUpdate):
1704         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h:
1705
1706 2019-06-13  Ludovico de Nittis  <ludovico.denittis@collabora.com>
1707
1708         [GTK] gdk_display_get_device_manager and gdk_screen_get_width/height are deprecated
1709         https://bugs.webkit.org/show_bug.cgi?id=198822
1710
1711         Reviewed by Carlos Garcia Campos.
1712
1713         GdkSeat and GdkRectangle should be used, respectively.
1714
1715         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
1716         (WebKit::doMouseEvent):
1717         (WebKit::doMotionEvent):
1718         (WebKit::doKeyStrokeEvent):
1719
1720 2019-06-12  Antoine Quint  <graouts@apple.com>
1721
1722         Show the web page URL when sharing an AR model
1723         https://bugs.webkit.org/show_bug.cgi?id=198812
1724         <rdar://problem/48689498>
1725
1726         Reviewed by Dean Jackson.
1727
1728         * UIProcess/Cocoa/DownloadClient.mm:
1729         (WebKit::DownloadClient::didStart):
1730         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
1731         (-[_WKPreviewControllerDataSource initWithMIMEType:originatingPageURL:]):
1732         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
1733         (WebKit::SystemPreviewController::start):
1734         (-[_WKPreviewControllerDataSource initWithMIMEType:]): Deleted.
1735         * UIProcess/SystemPreviewController.h:
1736
1737 2019-06-12  Antti Koivisto  <antti@apple.com>
1738
1739         Try to fix iOS build.
1740
1741         * NetworkProcess/Downloads/DownloadMap.cpp:
1742
1743 2019-06-12  Youenn Fablet  <youenn@apple.com>
1744
1745         Use NSURLSession for WebSocket
1746         https://bugs.webkit.org/show_bug.cgi?id=198568
1747
1748         Reviewed by Geoffrey Garen.
1749
1750         Implement socket channel provider on WebProcess level by sending IPC to NetworkProcess.
1751         On NetworkProcess side, use NSURLSession API to implement the WebSocket functionality. 
1752         This is a partial implementation:
1753         - inspector integration is not working.
1754         - some error cases are not well handled or are not producing the same error messages.
1755         - some features are not implemented (extensions, subprotocols, handshake authentication challenge, cookie handling...).
1756
1757         * CMakeLists.txt:
1758         * DerivedSources-input.xcfilelist:
1759         * DerivedSources-output.xcfilelist:
1760         * DerivedSources.make:
1761         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1762         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
1763         (WebKit::NetworkConnectionToWebProcess::createSocketChannel):
1764         (WebKit::NetworkConnectionToWebProcess::removeSocketChannel):
1765         * NetworkProcess/NetworkConnectionToWebProcess.h:
1766         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1767         * NetworkProcess/NetworkSession.cpp:
1768         (WebKit::NetworkSession::createWebSocketTask):
1769         * NetworkProcess/NetworkSession.h:
1770         (WebKit::NetworkSession::removeWebSocketTask):
1771         (WebKit::NetworkSession::addWebSocketTask):
1772         * NetworkProcess/NetworkSocketChannel.cpp: Added.
1773         (WebKit::NetworkSocketChannel::create):
1774         (WebKit::NetworkSocketChannel::NetworkSocketChannel):
1775         (WebKit::NetworkSocketChannel::~NetworkSocketChannel):
1776         (WebKit::NetworkSocketChannel::sendString):
1777         (WebKit::NetworkSocketChannel::sendData):
1778         (WebKit::NetworkSocketChannel::finishClosingIfPossible):
1779         (WebKit::NetworkSocketChannel::close):
1780         (WebKit::NetworkSocketChannel::didConnect):
1781         (WebKit::NetworkSocketChannel::didReceiveText):
1782         (WebKit::NetworkSocketChannel::didReceiveBinaryData):
1783         (WebKit::NetworkSocketChannel::didClose):
1784         (WebKit::NetworkSocketChannel::messageSenderConnection const):
1785         * NetworkProcess/NetworkSocketChannel.h: Added.
1786         * NetworkProcess/NetworkSocketChannel.messages.in: Added.
1787         * NetworkProcess/NetworkSocketStream.messages.in:
1788         * NetworkProcess/WebSocketTask.h: Added.
1789         (WebKit::WebSocketTask::sendString):
1790         (WebKit::WebSocketTask::sendData):
1791         (WebKit::WebSocketTask::close):
1792         (WebKit::WebSocketTask::cancel):
1793         (WebKit::WebSocketTask::resume):
1794         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
1795         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1796         (-[WKNetworkSessionDelegate existingWebSocketTask:]):
1797         (-[WKNetworkSessionDelegate URLSession:webSocketTask:didOpenWithProtocol:]):
1798         (-[WKNetworkSessionDelegate URLSession:webSocketTask:didCloseWithCode:reason:]):
1799         (WebKit::NetworkSessionCocoa::continueDidReceiveChallenge):
1800         (WebKit::NetworkSessionCocoa::createWebSocketTask):
1801         (WebKit::NetworkSessionCocoa::addWebSocketTask):
1802         (WebKit::NetworkSessionCocoa::removeWebSocketTask):
1803         (WebKit::NetworkSessionCocoa::webSocketDataTaskForIdentifier):
1804         * NetworkProcess/cocoa/WebSocketTaskCocoa.h: Added.
1805         * NetworkProcess/cocoa/WebSocketTaskCocoa.mm: Added.
1806         (WebKit::WebSocketTask::WebSocketTask):
1807         (WebKit::WebSocketTask::~WebSocketTask):
1808         (WebKit::WebSocketTask::readNextMessage):
1809         (WebKit::WebSocketTask::cancel):
1810         (WebKit::WebSocketTask::resume):
1811         (WebKit::WebSocketTask::didConnect):
1812         (WebKit::WebSocketTask::didClose):
1813         (WebKit::WebSocketTask::sendString):
1814         (WebKit::WebSocketTask::sendData):
1815         (WebKit::WebSocketTask::close):
1816         (WebKit::WebSocketTask::identifier const):
1817         * Shared/WebPreferences.yaml:
1818         * WebKit.xcodeproj/project.pbxproj:
1819         * WebProcess/Network/NetworkProcessConnection.cpp:
1820         (WebKit::NetworkProcessConnection::didReceiveMessage):
1821         * WebProcess/Network/WebSocketChannel.cpp: Added.
1822         (WebKit::WebSocketChannel::create):
1823         (WebKit::WebSocketChannel::WebSocketChannel):
1824         (WebKit::WebSocketChannel::~WebSocketChannel):
1825         (WebKit::WebSocketChannel::messageSenderConnection const):
1826         (WebKit::WebSocketChannel::messageSenderDestinationID const):
1827         (WebKit::WebSocketChannel::subprotocol):
1828         (WebKit::WebSocketChannel::extensions):
1829         (WebKit::WebSocketChannel::connect):
1830         (WebKit::WebSocketChannel::send):
1831         (WebKit::WebSocketChannel::bufferedAmount const):
1832         (WebKit::WebSocketChannel::close):
1833         (WebKit::WebSocketChannel::fail):
1834         (WebKit::WebSocketChannel::disconnect):
1835         (WebKit::WebSocketChannel::didConnect):
1836         (WebKit::WebSocketChannel::didReceiveText):
1837         (WebKit::WebSocketChannel::didReceiveBinaryData):
1838         (WebKit::WebSocketChannel::didClose):
1839         (WebKit::WebSocketChannel::didFail):
1840         (WebKit::WebSocketChannel::networkProcessCrashed):
1841         * WebProcess/Network/WebSocketChannel.h: Added.
1842         * WebProcess/Network/WebSocketChannel.messages.in: Added.
1843         * WebProcess/Network/WebSocketChannelManager.cpp: Added.
1844         (WebKit::WebSocketChannelManager::createWebSocketChannel):
1845         (WebKit::WebSocketChannelManager::networkProcessCrashed):
1846         (WebKit::WebSocketChannelManager::didReceiveMessage):
1847         * WebProcess/Network/WebSocketChannelManager.h: Added.
1848         * WebProcess/Network/WebSocketProvider.cpp:
1849         (WebKit::WebSocketProvider::createWebSocketChannel):
1850         * WebProcess/Network/WebSocketProvider.h:
1851         * WebProcess/Network/WebSocketStream.cpp:
1852         * WebProcess/Network/WebSocketStream.messages.in:
1853         * WebProcess/WebProcess.cpp:
1854         (WebKit::WebProcess::networkProcessConnectionClosed):
1855         * WebProcess/WebProcess.h:
1856         (WebKit::WebProcess::webSocketChannelManager):
1857
1858 2019-06-12  Sihui Liu  <sihui_liu@apple.com>
1859
1860         Add assertions to help debug crash at WebKit::HistoryEntryDataEncoder::operator<<
1861         https://bugs.webkit.org/show_bug.cgi?id=198766
1862
1863         Reviewed by Geoffrey Garen.
1864
1865         * Shared/SessionState.h:
1866         (WebKit::FrameState::~FrameState):
1867         * UIProcess/API/C/WKPage.cpp:
1868         (WKPageCopySessionState):
1869         * UIProcess/mac/LegacySessionStateCoding.cpp:
1870         (WebKit::HistoryEntryDataEncoder::encodeFixedLengthData):
1871         (WebKit::encodeFrameStateNode):
1872
1873 2019-06-12  Ludovico de Nittis  <ludovico.denittis@collabora.com>
1874
1875         [GTK] GTK_STOCK_* types have been deprecated since GTK 3.10
1876         https://bugs.webkit.org/show_bug.cgi?id=198787
1877
1878         Reviewed by Michael Catanzaro.
1879
1880         We completely remove the gtkStockIDFromContextMenuAction function in order to get rid of the stock items.
1881         This function was used only in "createActionIfNeeded" where now we pass a nullptr as a stock_id variable.
1882
1883         * Shared/glib/WebContextMenuItemGlib.cpp:
1884         (WebKit::gtkStockIDFromContextMenuAction):
1885
1886 2019-06-12  Brent Fulgham  <bfulgham@apple.com>
1887
1888         Unreviewed fix after rr246360.
1889
1890         The current code accidentally calls the completion handler twice.
1891
1892         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1893         (-[WKWebsiteDataStore _setPrevalentDomain:completionHandler:]):
1894
1895 2019-06-12  Jiewen Tan  <jiewen_tan@apple.com>
1896
1897         REGRESSION (r245043) [Mac WK2 Debug] ASSERTION FAILED: m_services.isEmpty() && transports.size() <= maxTransportNumber seen with two http/wpt/webauthn/public-key-credential-* tests
1898         https://bugs.webkit.org/show_bug.cgi?id=197917
1899         <rdar://problem/51524958>
1900
1901         Reviewed by Brent Fulgham.
1902
1903         This is a race condition that when a new request comes in the middle between the previous one finishes and the clearStateAsync is queued in the main thread.
1904         Therefore, when the new request starts discovery, it will still see previous request's state.
1905
1906         To fix this issue, clearState() will be called unconditionally for every request. And a guard is added to clearState() to prevent double clearance.
1907
1908         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
1909         (WebKit::AuthenticatorManager::makeCredential):
1910         (WebKit::AuthenticatorManager::getAssertion):
1911         (WebKit::AuthenticatorManager::clearState):
1912
1913 2019-06-12  Brent Fulgham  <bfulgham@apple.com>
1914
1915         Add mechanism and test case to check if ITP is active
1916         https://bugs.webkit.org/show_bug.cgi?id=198694
1917         <rdar://problem/51557704>
1918
1919         Reviewed by Youenn Fablet.
1920
1921         Add a new private SPI call on the WebsiteDataStore object that allows test code
1922         to mark a domain as prevalent, and check the prevalance of a resource. This
1923         is then used to build a test to confirm ITP is active and working.
1924
1925         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1926         (-[WKWebsiteDataStore _setPrevalentDomain:completionHandler:]):
1927         (-[WKWebsiteDataStore _getIsPrevalentDomain:completionHandler:]):
1928         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1929
1930 2019-06-12  Wenson Hsieh  <wenson_hsieh@apple.com>
1931
1932         Many layout tests are failing on iPad simulator due to unexpected viewport dimensions
1933         https://bugs.webkit.org/show_bug.cgi?id=198789
1934         <rdar://problem/51595519>
1935
1936         Reviewed by Simon Fraser.
1937
1938         Prevent the shrink-to-fit-content timer from activating on layout tests that use the testing viewport
1939         configuration.
1940
1941         * WebProcess/WebPage/ios/WebPageIOS.mm:
1942         (WebKit::WebPage::immediatelyShrinkToFitContent):
1943
1944 2019-06-12  Michael Catanzaro  <mcatanzaro@igalia.com>
1945
1946         [WPE][GTK] Deprecate WebSQL APIs
1947         https://bugs.webkit.org/show_bug.cgi?id=195011
1948
1949         Reviewed by Carlos Garcia Campos.
1950
1951         * UIProcess/API/glib/WebKitSettings.cpp:
1952         (webkit_settings_class_init):
1953         * UIProcess/API/glib/WebKitWebContext.cpp:
1954         (webkitWebContextConstructed):
1955         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
1956         (webkitWebsiteDataManagerGetProperty):
1957         (webkit_website_data_manager_class_init):
1958         * UIProcess/API/gtk/WebKitWebsiteData.h:
1959         * UIProcess/API/gtk/WebKitWebsiteDataManager.h:
1960         * UIProcess/API/wpe/WebKitWebsiteData.h:
1961         * UIProcess/API/wpe/WebKitWebsiteDataManager.h:
1962
1963 2019-06-12  Michael Catanzaro  <mcatanzaro@igalia.com>
1964
1965         [WPE][GTK] Enable hyperlink auditing
1966         https://bugs.webkit.org/show_bug.cgi?id=197845
1967
1968         Reviewed by Carlos Garcia Campos.
1969
1970         * UIProcess/API/glib/WebKitSettings.cpp:
1971         (webkit_settings_class_init):
1972
1973 2019-06-12  Ludovico de Nittis  <ludovico.denittis@collabora.com>
1974
1975         [GTK] gtk_misc_set_alignment is deprecated since GTK 3.14
1976         https://bugs.webkit.org/show_bug.cgi?id=198785
1977
1978         Reviewed by Carlos Garcia Campos.
1979
1980         Replace the deprecated gtk_misc_set_alignment with halign and valign.
1981
1982         * UIProcess/API/gtk/WebKitAuthenticationDialog.cpp:
1983         (createLabelWithLineWrap):
1984
1985 2019-06-11  Wenson Hsieh  <wenson_hsieh@apple.com>
1986
1987         [iOS] Idempotent text autosizing needs to react properly to viewport changes
1988         https://bugs.webkit.org/show_bug.cgi?id=198736
1989         <rdar://problem/50591911>
1990
1991         Reviewed by Zalan Bujtas.
1992
1993         If idempotent text autosizing is enabled, respond to viewport initial scale changes by forcing a style recalc,
1994         since the amount by which idempotent text autosizing boosts font sizes depends on the Page's initial scale.
1995
1996         * WebProcess/WebPage/WebPage.h:
1997         * WebProcess/WebPage/ios/WebPageIOS.mm:
1998         (WebKit::WebPage::resetIdempotentTextAutosizingIfNeeded):
1999         (WebKit::WebPage::viewportConfigurationChanged):
2000
2001 2019-06-11  Zalan Bujtas  <zalan@apple.com>
2002
2003         LayoutTests/fast/events/touch/ios/double-tap-for-double-click* test cases are failing
2004         https://bugs.webkit.org/show_bug.cgi?id=198764
2005         <rdar://problem/51035459>
2006
2007         Reviewed by Wenson Hsieh.
2008
2009         This patch replaces the existing, _doubleTapGestureRecognizerForDoubleClick based double click handling with a WebProcess based implementation using
2010         the potentialTapAtPosition/commitPotentialTap infrastructure.
2011
2012         * Shared/WebPageCreationParameters.cpp:
2013         (WebKit::WebPageCreationParameters::encode const):
2014         (WebKit::WebPageCreationParameters::decode):
2015         * Shared/WebPageCreationParameters.h:
2016         * UIProcess/PageClient.h:
2017         * UIProcess/WebPageProxy.cpp:
2018         (WebKit::WebPageProxy::creationParameters):
2019         * UIProcess/WebPageProxy.h:
2020         * UIProcess/ios/PageClientImplIOS.h:
2021         * UIProcess/ios/PageClientImplIOS.mm:
2022         (WebKit::PageClientImpl::doubleTapForDoubleClickDelay):
2023         (WebKit::PageClientImpl::doubleTapForDoubleClickRadius):
2024         * UIProcess/ios/WKContentViewInteraction.h:
2025         * UIProcess/ios/WKContentViewInteraction.mm:
2026         (-[WKContentView _ensureNonBlockingDoubleTapGestureRecognizer]):
2027         (-[WKContentView setupInteraction]):
2028         (-[WKContentView cleanupInteraction]):
2029         (-[WKContentView _removeDefaultGestureRecognizers]):
2030         (-[WKContentView _addDefaultGestureRecognizers]):
2031         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
2032         (-[WKContentView gestureRecognizerShouldBegin:]):
2033         (-[WKContentView _didStartProvisionalLoadForMainFrame]):
2034         (-[WKContentView _doubleTapForDoubleClickDelay]):
2035         (-[WKContentView _doubleTapForDoubleClickRadius]):
2036         (-[WKContentView _doubleTapRecognizedForDoubleClick:]): Deleted.
2037         * UIProcess/ios/WebPageProxyIOS.mm:
2038         (WebKit::WebPageProxy::handleDoubleTapForDoubleClickAtPoint): Deleted.
2039         * WebProcess/WebPage/WebPage.cpp:
2040         * WebProcess/WebPage/WebPage.h:
2041         * WebProcess/WebPage/WebPage.messages.in:
2042         * WebProcess/WebPage/ios/WebPageIOS.mm:
2043         (WebKit::WebPage::handlePotentialDoubleTapForDoubleClickAtPoint):
2044         (WebKit::WebPage::commitPotentialTap):
2045         (WebKit::WebPage::handleDoubleTapForDoubleClickAtPoint): Deleted.
2046
2047 2019-06-11  Andy Estes  <aestes@apple.com>
2048
2049         [Apple Pay] ASSERTION FAILED: m_state == State::Activating under WebPaymentCoordinatorProxy::showPaymentUI
2050         https://bugs.webkit.org/show_bug.cgi?id=198776
2051         <rdar://problem/49123795>
2052
2053         Reviewed by Brian Weinstein.
2054
2055         It's possible that an active session is aborted before the completion handler passed to
2056         platformShowPaymentUI() has executed. When that happens, m_state will be Idle even though we
2057         assert that it is Activating. Fix this by returning early in the platformShowPaymentUI()
2058         completion handler when m_state is Idle.
2059
2060         It's not possible to write a layout test for this because MockPaymentCoordinator handles
2061         showing payment UI directly in the web process, so this code is not executed in layout
2062         tests. The assertion can be reproduced manually by loading
2063         https://w3c-test.org/payment-request/payment-is-showing.https.html and clicking the button.
2064
2065         * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
2066         (WebKit::WebPaymentCoordinatorProxy::showPaymentUI):
2067
2068 2019-06-11  Patrick Griffis  <pgriffis@igalia.com>
2069
2070         [GTK] Fix a11y support in bubblewrap sandbox
2071         https://bugs.webkit.org/show_bug.cgi?id=198777
2072
2073         Reviewed by Michael Catanzaro.
2074
2075         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
2076         (WebKit::bindA11y):
2077
2078 2019-06-11  Timothy Hatcher  <timothy@apple.com>
2079
2080         Flash when tapping compose button after switching to/from dark mode without restarting Mail.
2081         https://bugs.webkit.org/show_bug.cgi?id=198769
2082         rdar://problem/51370037
2083
2084         Reviewed by Tim Horton.
2085
2086         Accessing a dynamic color outside a normal UIView choke point without setting
2087         UITraitCollection.currentTraitCollection first can cause undefined results.
2088         Use LocalCurrentTraitCollection inside scrollViewBackgroundColor when accessing
2089         the dynamic system UIColors. Also use systemBackgroundColor instead of white.
2090
2091         * UIProcess/API/Cocoa/WKWebView.mm:
2092         (scrollViewBackgroundColor):
2093
2094 2019-06-11  Megan Gardner  <megan_gardner@apple.com>
2095
2096         Integrate scrollbar gestures for iOS
2097         https://bugs.webkit.org/show_bug.cgi?id=198767
2098
2099         Reviewed by Tim Horton.
2100
2101         * UIProcess/ios/WKContentViewInteraction.mm:
2102         (_WKGestureRecognizerIsBuiltInScrollViewGestureRecognizer):
2103         (-[WKContentView gestureRecognizer:canPreventGestureRecognizer:]):
2104
2105 2019-06-11  Timothy Hatcher  <timothy@apple.com>
2106
2107         Scrollbar can show as white on white in dark mode on iOS.
2108         https://bugs.webkit.org/show_bug.cgi?id=198772
2109         rdar://problem/51516743
2110
2111         Reviewed by Tim Horton.
2112
2113         * UIProcess/API/Cocoa/WKWebView.mm:
2114         (-[WKWebView _updateScrollViewBackground]): Use UIScrollViewIndicatorStyleBlack instead
2115         of UIScrollViewIndicatorStyleDefault to prevent getting a white scrollbar in dark mode.
2116
2117 2019-06-11  Michael Catanzaro  <mcatanzaro@igalia.com>
2118
2119         Unreviewed build warning fixes
2120
2121         Silence -Wunused-variable warning
2122
2123         * UIProcess/WebProcessPool.cpp:
2124         (WebKit::WebProcessPool::clearWebProcessIsPlayingAudibleMedia):
2125
2126 2019-06-11  Simon Fraser  <simon.fraser@apple.com>
2127
2128         Fix non-internal builds after r246327.
2129
2130         * Platform/spi/ios/UIKitSPI.h:
2131
2132 2019-06-10  Simon Fraser  <simon.fraser@apple.com>
2133
2134         Add logging for UI-side compositing hit-testing
2135         https://bugs.webkit.org/show_bug.cgi?id=198739
2136
2137         Reviewed by Antti Koivisto.
2138
2139         Make it easier to debug UI-side compositing hit-testing issues with a UIHitTesting log
2140         channel, which logs information about the UIView hierarchy, which views are found by
2141         hit-testing, and what touch-actions apply.
2142
2143         This log channel can be set by passing the argument '-WebKit2Logging "UIHitTesting"' when
2144         launching a debug iOS MobileSafari instance.
2145
2146         * Platform/Logging.h:
2147         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
2148         (-[UIView _web_findDescendantViewAtPoint:withEvent:]):
2149         * UIProcess/ios/WKContentViewInteraction.mm:
2150         (-[WKContentView hitTest:withEvent:]):
2151         (-[WKContentView _handleTouchActionsForTouchEvent:]):
2152
2153 2019-06-11  Antti Koivisto  <antti@apple.com>
2154
2155         REGRESSION (iOS): Can't scroll litter-robot.com checkout form's dropdown menus
2156         https://bugs.webkit.org/show_bug.cgi?id=198753
2157         <rdar://problem/51355686>
2158
2159         Reviewed by Simon Fraser.
2160
2161         If an element with 'overflow:scroll' also had 'visibility:hidden' or 'pointer-events:none' it would
2162         capture touches and prevent scrolling of any overlapped scrollers.
2163
2164         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
2165         (WebKit::collectDescendantViewsAtPoint):
2166
2167         Filter out views with 'isUserInteractionEnabled == NO' (set for hidden and pointer-events:none layers).
2168         This prevents it being considered as the first view hit when determining scrolling relationships.
2169
2170         (-[UIView _web_findDescendantViewAtPoint:withEvent:]):
2171
2172         No need to skip here anymore.
2173
2174 2019-06-11  Wenson Hsieh  <wenson_hsieh@apple.com>
2175
2176         Quotes are always inserted as smart quotes on stackblitz.com, causing compilation errors
2177         https://bugs.webkit.org/show_bug.cgi?id=198735
2178         <rdar://problem/51557159>
2179
2180         Reviewed by Megan Gardner.
2181
2182         Add a flag in FocusedElementInformation to indicate whether spellchecking is allowed in the focused element.
2183         If spellchecking is not allowed, then disable smart quotes and dashes, which matches behavior on macOS.
2184
2185         * Shared/FocusedElementInformation.cpp:
2186         (WebKit::FocusedElementInformation::encode const):
2187         (WebKit::FocusedElementInformation::decode):
2188         * Shared/FocusedElementInformation.h:
2189         * UIProcess/ios/WKContentViewInteraction.mm:
2190         (-[WKContentView textInputTraits]):
2191         * WebProcess/WebPage/ios/WebPageIOS.mm:
2192         (WebKit::WebPage::getFocusedElementInformation):
2193
2194 2019-06-11  Carlos Garcia Campos  <cgarcia@igalia.com>
2195
2196         [GTK] Remove option REDIRECTED_XCOMPOSITE_WINDOW
2197         https://bugs.webkit.org/show_bug.cgi?id=198748
2198
2199         Reviewed by Žan Doberšek.
2200
2201         It's unused and untested, we kept that code path only because the redirected window caused performance issues in
2202         some drivers in embedded devices. Nowadays there are much better solutions for those cases like using WPE port
2203         or GTK port under wayland instead of X11.
2204
2205         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
2206         (WebKit::ThreadedCompositor::create): Remove the ShouldDoFrameSync parameter since it always receives Yes.
2207         (WebKit::ThreadedCompositor::ThreadedCompositor): Ditto.
2208         (WebKit::ThreadedCompositor::createGLContext): Remove the code to handle the case of ShouldDoFrameSync being No,
2209         since it's always Yes.
2210         (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing): Deleted.
2211         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
2212         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2213         (webkitWebViewBaseRealize): Remove the code for !USE(REDIRECTED_XCOMPOSITE_WINDOW).
2214         (webkitWebViewBaseUnrealize): Ditto.
2215         (webkitWebViewBaseDraw): acceleratedBackingStore member can't be nullptr now.
2216         (webkitWebViewBaseEnterAcceleratedCompositingMode): Ditto.
2217         (webkitWebViewBaseUpdateAcceleratedCompositingMode): Ditto.
2218         (webkitWebViewBaseExitAcceleratedCompositingMode): Ditto.
2219         (webkitWebViewBaseMakeGLContextCurrent): Ditto.
2220         (webkitWebViewBaseDidRelaunchWebProcess): Remove the code for !USE(REDIRECTED_XCOMPOSITE_WINDOW).
2221         (webkitWebViewBasePageClosed): Ditto.
2222         (webkitWebViewBaseRenderHostFileDescriptor): acceleratedBackingStore member can't be nullptr now.
2223         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
2224         (WebKit::DrawingAreaProxyCoordinatedGraphics::didUpdateBackingStoreState): Remove the code for !USE(REDIRECTED_XCOMPOSITE_WINDOW).
2225         (WebKit::DrawingAreaProxyCoordinatedGraphics::setNativeSurfaceHandleForCompositing): Deleted.
2226         (WebKit::DrawingAreaProxyCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing): Deleted.
2227         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h:
2228         * UIProcess/gtk/AcceleratedBackingStore.cpp:
2229         (WebKit::AcceleratedBackingStore::create): Add an assert to ensure we create an AcceleratedBackingStore.
2230         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
2231         * UIProcess/gtk/AcceleratedBackingStoreX11.h:
2232         * UIProcess/gtk/HardwareAccelerationManager.cpp:
2233         (WebKit::HardwareAccelerationManager::HardwareAccelerationManager): Remove the code for !USE(REDIRECTED_XCOMPOSITE_WINDOW).
2234         * WebProcess/WebPage/AcceleratedSurface.cpp:
2235         (WebKit::AcceleratedSurface::create): Add an assert to ensure we create an AcceleratedSurface.
2236         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
2237         (WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode): Remove the code for !USE(REDIRECTED_XCOMPOSITE_WINDOW).
2238         (WebKit::DrawingAreaCoordinatedGraphics::setNativeSurfaceHandleForCompositing): Deleted.
2239         (WebKit::DrawingAreaCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing): Deleted.
2240         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h:
2241         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
2242         (WebKit::LayerTreeHost::LayerTreeHost): m_surface can't be nullptr now.
2243         (WebKit::LayerTreeHost::sizeDidChange): Ditto.
2244         (WebKit::LayerTreeHost::deviceOrPageScaleFactorChanged): Ditto.
2245         (WebKit::LayerTreeHost::nativeSurfaceHandleForCompositing): Ditto.
2246         (WebKit::LayerTreeHost::didDestroyGLContext): Ditto.
2247         (WebKit::LayerTreeHost::willRenderFrame): Ditto.
2248         (WebKit::LayerTreeHost::didRenderFrame): Ditto.
2249         (WebKit::LayerTreeHost::setNativeSurfaceHandleForCompositing): Deleted.
2250         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h:
2251         * WebProcess/WebPage/DrawingArea.h:
2252         * WebProcess/WebPage/DrawingArea.messages.in:
2253         * WebProcess/WebPage/WebPage.h:
2254         (WebKit::WebPage::nativeWindowHandle): Deleted.
2255         * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.cpp:
2256         * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.h:
2257
2258 2019-06-11  Michael Catanzaro  <mcatanzaro@igalia.com>
2259
2260         [WPE][GTK] bubblewrap sandbox should grant access to web extensions directory
2261         https://bugs.webkit.org/show_bug.cgi?id=198734
2262
2263         Reviewed by Carlos Garcia Campos.
2264
2265         * UIProcess/API/glib/WebKitWebContext.cpp:
2266         (webkit_web_context_set_web_extensions_directory):
2267
2268 2019-06-10  Andy Estes  <aestes@apple.com>
2269
2270         [iOS] Use PDFKit SPI for taking snapshots when the hosting app is not entitled for global capture
2271         https://bugs.webkit.org/show_bug.cgi?id=198731
2272         <rdar://problem/46215174>
2273
2274         Reviewed by Tim Horton.
2275
2276         PDFHostViewController renders PDF contents in a view service, and apps are unable to
2277         snapshot views rendered out-of-process without an entitlement.
2278
2279         When an app is missing this entitlement and calls WKWebView's
2280         takeSnapshotWithConfiguration: API when a PDF is displayed, fall back to calling
2281         PDFHostViewController's snapshotting SPI.
2282
2283         Testing is blocked by <https://webkit.org/b/175204>.
2284
2285         * Platform/spi/ios/PDFKitSPI.h:
2286         * UIProcess/API/Cocoa/WKWebView.mm:
2287         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
2288         * UIProcess/Cocoa/WKWebViewContentProvider.h:
2289         * UIProcess/ios/WKPDFView.mm:
2290         (+[WKPDFView web_requiresCustomSnapshotting]):
2291         (-[WKPDFView web_snapshotRectInContentViewCoordinates:snapshotWidth:completionHandler:]):
2292         * UIProcess/ios/WKSystemPreviewView.mm:
2293         (+[WKSystemPreviewView web_requiresCustomSnapshotting]):
2294
2295 2019-06-10  Sam Weinig  <weinig@apple.com>
2296
2297         Remove Dashboard support
2298         https://bugs.webkit.org/show_bug.cgi?id=198615
2299
2300         Reviewed by Ryosuke Niwa.
2301
2302         * Configurations/FeatureDefines.xcconfig:
2303         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
2304         (WKBundleSetUseDashboardCompatibilityMode): Deleted.
2305         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
2306         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2307         (WebKit::InjectedBundle::setUseDashboardCompatibilityMode): Deleted.
2308         * WebProcess/InjectedBundle/InjectedBundle.h:
2309         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2310         (WebKit::WebChromeClient::annotatedRegionsChanged): Deleted.
2311         * WebProcess/WebCoreSupport/WebChromeClient.h:
2312
2313 2019-06-10  Wenson Hsieh  <wenson_hsieh@apple.com>
2314
2315         [iOS] fast/xsl tests are flaky when run after certain viewport shrink-to-fit tests
2316         https://bugs.webkit.org/show_bug.cgi?id=198699
2317         <rdar://problem/50501718>
2318
2319         Reviewed by Simon Fraser.
2320
2321         Lift logic that sets the "IsKnownToLayOutWiderThanViewport" flag out of resetViewportDefaultConfiguration, and
2322         into didCommitLoad instead (along with other logic for resetting viewport arguments). The previous method,
2323         resetViewportDefaultConfiguration, was being triggered very frequently undo didReceiveMobileDocType, causing the
2324         shrink-to-fit heuristic to sometimes take no effect. The original intention here was simply to reset the flag
2325         upon page load.
2326
2327         * WebProcess/WebPage/WebPage.cpp:
2328         (WebKit::WebPage::didCommitLoad):
2329         * WebProcess/WebPage/ios/WebPageIOS.mm:
2330         (WebKit::WebPage::resetViewportDefaultConfiguration):
2331
2332 2019-06-10  Timothy Hatcher  <timothy@apple.com>
2333
2334         Integrate dark mode support for iOS.
2335         https://bugs.webkit.org/show_bug.cgi?id=198687
2336         rdar://problem/51545643
2337
2338         Reviewed by Tim Horton.
2339
2340         * Configurations/FeatureDefines.xcconfig:
2341         * UIProcess/API/Cocoa/WKWebView.mm:
2342         (-[WKWebView _effectiveAppearanceIsDark]):
2343         (-[WKWebView _effectiveAppearanceIsInactive]):
2344         (-[WKWebView _dynamicUserInterfaceTraitDidChange]):
2345         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2346         * UIProcess/ios/PageClientImplIOS.h:
2347         * UIProcess/ios/PageClientImplIOS.mm:
2348         (WebKit::PageClientImpl::effectiveAppearanceIsDark const):
2349         (WebKit::PageClientImpl::effectiveAppearanceIsInactive const):
2350         * UIProcess/ios/WKPasswordView.mm:
2351         (-[WKPasswordView showInScrollView:]):
2352         (configureScrollView): Deleted.
2353
2354 2019-06-10  Sihui Liu  <sihui_liu@apple.com>
2355
2356         [WKHTTPCookieStore getAllCookies:] may return duplicate cookies
2357         https://bugs.webkit.org/show_bug.cgi?id=198635
2358         <rdar://problem/46010232>
2359
2360         Reviewed by Ryosuke Niwa.
2361
2362         When there is no process pool, we store cookies set in memory with HashSet m_pendingCookies of WebsiteDataStore.
2363
2364         HashSet does not contain duplicate Cookies that are completely identical, but it may contain Cookies that have 
2365         all the other properties identical other than value. This is not correct because Cookies with same name, domain
2366         and path should be treated as the same cookie. When a cookie is set via API, we should either insert the 
2367         cookie into m_pendingCookies if the cookie does not exist, or update the cookie value if it already exists.
2368
2369         Note that we still use HashSet with CookieHash for m_pendingCookies because in cookie deletion, we only delete 
2370         cookie when there is a complete match. If some cookie from m_pendingCookies has all other properties the same as
2371         the cookie specified in the deletion function, but the value is different, it will not be removed.
2372
2373         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2374         (WebKit::WebsiteDataStore::addPendingCookie):
2375
2376 2019-06-10  Philippe Normand  <pnormand@igalia.com>
2377
2378         [WPE][Qt] Port to new wpe_fdo_egl_exported_image API
2379         https://bugs.webkit.org/show_bug.cgi?id=198713
2380
2381         Reviewed by Carlos Garcia Campos.
2382
2383         * UIProcess/API/wpe/qt/WPEQtViewBackend.cpp:
2384         (WPEQtViewBackend::WPEQtViewBackend):
2385         (WPEQtViewBackend::texture):
2386         (WPEQtViewBackend::displayImage):
2387         * UIProcess/API/wpe/qt/WPEQtViewBackend.h:
2388
2389 2019-06-09  Brent Fulgham  <bfulgham@apple.com>
2390
2391         [iOS] ResourceLoadStatistics state is not properly relayed to the NetworkProcess
2392         https://bugs.webkit.org/show_bug.cgi?id=198692
2393         <rdar://problem/51538088>
2394
2395         Reviewed by Maciej Stachowiak.
2396
2397         * UIProcess/WebProcessPool.cpp:
2398         (WebKit::WebProcessPool::setResourceLoadStatisticsEnabled): Message the NetworkProcess
2399         on state change.
2400
2401 2019-06-08  Dean Jackson  <dino@apple.com>
2402
2403         Drag starting state can get stuck even though the drag has ended
2404         https://bugs.webkit.org/show_bug.cgi?id=198696
2405         <rdar://problem/51556045>
2406
2407         Reviewed by Wenson Hsieh.
2408
2409         In iOS 13, we're seeing cases of the DragSession not
2410         correctly ending, and thus leaving m_isStartingDrag in
2411         an incorrect state. Temporarily force this to be reset
2412         in ::dragEnded while investigating
2413
2414         * UIProcess/ios/WKContentViewInteraction.mm: Add some more release logging
2415         while here.
2416         (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
2417         (-[WKContentView dragInteraction:item:willAnimateCancelWithAnimator:]):
2418         * WebProcess/WebPage/WebPage.cpp:
2419         (WebKit::WebPage::dragEnded):
2420
2421 2019-06-08  Wenson Hsieh  <wenson_hsieh@apple.com>
2422
2423         [iOS] The default application name for user agent when requesting desktop content is still "Mobile/15E148"
2424         https://bugs.webkit.org/show_bug.cgi?id=198693
2425         <rdar://problem/51555371>
2426
2427         Reviewed by Tim Horton.
2428
2429         Fixes the bug by introducing an applicationNameForDesktopUserAgent member to WebPageProxy. This
2430         applicationNameForDesktopUserAgent is set alongside the regular applicationNameForUserAgent; however, in the
2431         case where it is being set via WKWebViewConfiguration, use WKWebViewConfiguration's
2432         _applicationNameForDesktopUserAgent instead. See below for more details.
2433
2434         Tested by adding to the existing API test PreferredContentMode.ApplicationNameForDesktopUserAgent.
2435
2436         * UIProcess/API/APIWebsitePolicies.cpp:
2437         (API::WebsitePolicies::copy const):
2438         * UIProcess/API/APIWebsitePolicies.h:
2439
2440         Drive-by fix: rename applicationNameForUserAgentWithModernCompatibility to applicationNameForDesktopUserAgent in
2441         a few places.
2442
2443         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
2444         (-[WKBrowsingContextController setApplicationNameForUserAgent:]):
2445         * UIProcess/API/Cocoa/WKWebView.mm:
2446         (-[WKWebView _initializeWithConfiguration:]):
2447         (-[WKWebView _setApplicationNameForUserAgent:]):
2448         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2449
2450         Change _applicationNameForUserAgent into an Optional<RetainPtr<NSString>>. A value of WTF::nullopt allows us to
2451         know that the default application name should be used (which is different when requesting desktop content).
2452
2453         (-[WKWebViewConfiguration encodeWithCoder:]):
2454         (-[WKWebViewConfiguration initWithCoder:]):
2455         (-[WKWebViewConfiguration copyWithZone:]):
2456         (-[WKWebViewConfiguration _applicationNameForDesktopUserAgent]):
2457
2458         Add _applicationNameForDesktopUserAgent to the web view configuration. This behaves like
2459         applicationNameForUserAgent, with one exception: in the case where the default applicationNameForUserAgent is
2460         used (i.e. the client has not specified any application name), default to `nil` as the application name for user
2461         agent, rather than "Mobile/15E148".
2462
2463         (-[WKWebViewConfiguration applicationNameForUserAgent]):
2464         (-[WKWebViewConfiguration setApplicationNameForUserAgent:]):
2465         * UIProcess/API/Cocoa/WKWebViewConfigurationInternal.h:
2466         * UIProcess/API/Cocoa/WKWebpagePreferences.mm:
2467         (-[WKWebpagePreferences _applicationNameForUserAgentWithModernCompatibility]):
2468         (-[WKWebpagePreferences _setApplicationNameForUserAgentWithModernCompatibility:]):
2469         * UIProcess/WebPageProxy.h:
2470         (WebKit::WebPageProxy::setApplicationNameForDesktopUserAgent):
2471         (WebKit::WebPageProxy::applicationNameForDesktopUserAgent const):
2472         * UIProcess/ios/WebPageProxyIOS.mm:
2473         (WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):
2474
2475 2019-06-08  Andy Estes  <aestes@apple.com>
2476
2477         [Apple Pay] If we have a bound interface identifier, set it on new PKPaymentRequests
2478         https://bugs.webkit.org/show_bug.cgi?id=198690
2479         <rdar://problem/48041803>
2480
2481         Reviewed by Tim Horton.
2482
2483         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
2484         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2485         (WebKit::NetworkSessionCocoa::boundInterfaceIdentifier const): Implemented a public getter
2486         for m_boundInterfaceIdentifier.
2487
2488         * NetworkProcess/NetworkConnectionToWebProcess.h:
2489         * NetworkProcess/ios/NetworkConnectionToWebProcessIOS.mm:
2490         (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorBoundInterfaceIdentifier):
2491         Implemented an override for paymentCoordinatorBoundInterfaceIdentifier.
2492
2493         * Shared/ApplePay/WebPaymentCoordinatorProxy.h: Declared
2494         paymentCoordinatorBoundInterfaceIdentifier for clients to override.
2495
2496         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2497         (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): If the client has a non-empty
2498         bound interface identifier, set it on the new PKPaymentRequest.
2499
2500         * UIProcess/WebPageProxy.h:
2501         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2502         (WebKit::WebPageProxy::paymentCoordinatorBoundInterfaceIdentifier): Implemented an override
2503         for paymentCoordinatorBoundInterfaceIdentifier.
2504
2505 2019-06-07  Antti Koivisto  <antti@apple.com>
2506
2507         REGRESSION (r245006): Setting scrollview.scrollEnabled clobbers any scrollEnabled set by a client
2508         https://bugs.webkit.org/show_bug.cgi?id=198656
2509         <rdar://problem/51494585>
2510
2511         Reviewed by Tim Horton.
2512
2513         Allow client to disable scrolling and zooming.
2514
2515         * UIProcess/API/Cocoa/WKWebView.mm:
2516         (-[WKWebView _didCommitLayerTree:]):
2517         * UIProcess/ios/WKScrollView.h:
2518         * UIProcess/ios/WKScrollView.mm:
2519         (-[WKScrollView initWithFrame:]):
2520         (-[WKScrollView setScrollEnabled:]):
2521         (-[WKScrollView _setScrollEnabledInternal:]):
2522         (-[WKScrollView _updateScrollability]):
2523         (-[WKScrollView setZoomEnabled:]):
2524         (-[WKScrollView _setZoomEnabledInternal:]):
2525         (-[WKScrollView _updateZoomability]):
2526
2527 2019-06-07  Wenson Hsieh  <wenson_hsieh@apple.com>
2528
2529         Allow clients to vend custom -inputView and -inputAccessoryView by overriding WKWebView methods
2530         https://bugs.webkit.org/show_bug.cgi?id=198631
2531         <rdar://problem/51505431>
2532
2533         Reviewed by Tim Horton.
2534
2535         Allow WKWebView API clients to override WKContentView's default input view and/or input accessory view by
2536         subclassing WKWebView and implementing -inputView or -inputAccessoryView.
2537
2538         * UIProcess/API/Cocoa/WKWebView.mm:
2539         (-[WKWebView inputAccessoryView]):
2540         (-[WKWebView inputView]):
2541         * UIProcess/ios/WKContentViewInteraction.h:
2542         * UIProcess/ios/WKContentViewInteraction.mm:
2543         (-[WKContentView inputView]):
2544         (-[WKContentView inputViewForWebView]):
2545         (-[WKContentView inputAccessoryView]):
2546         (-[WKContentView inputAccessoryViewForWebView]):
2547
2548 2019-06-07  Tim Horton  <timothy_horton@apple.com>
2549
2550         Disable focus rings on WKContentView for PLATFORM(IOSMAC)
2551         https://bugs.webkit.org/show_bug.cgi?id=198685
2552
2553         Reviewed by Simon Fraser.
2554
2555         * Platform/spi/ios/UIKitSPI.h:
2556         * UIProcess/ios/WKContentView.mm:
2557         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
2558
2559 2019-06-07  Megan Gardner  <megan_gardner@apple.com>
2560
2561         Extend quirks to emulate bold/italic/underline in hidden editable areas
2562         https://bugs.webkit.org/show_bug.cgi?id=198681
2563
2564         Reviewed by Wenson Hsieh.
2565
2566         * Shared/FocusedElementInformation.cpp:
2567         (WebKit::FocusedElementInformation::encode const):
2568         (WebKit::FocusedElementInformation::decode):
2569         * Shared/FocusedElementInformation.h:
2570         * Shared/SyntheticEditingCommandType.h:
2571         * UIProcess/ios/WKContentView.mm:
2572         (-[WKContentView undoManager]):
2573         * UIProcess/ios/WKContentViewInteraction.mm:
2574         (shouldSynthezieKeyEvents):
2575         (-[WKContentView toggleBoldfaceForWebView:]):
2576         (-[WKContentView toggleItalicsForWebView:]):
2577         (-[WKContentView toggleUnderlineForWebView:]):
2578         (-[WKContentView _elementDidBlur]):
2579         * WebProcess/WebPage/ios/WebPageIOS.mm:
2580         (WebKit::WebPage::generateSyntheticEditingCommand):
2581         (WebKit::WebPage::getFocusedElementInformation):
2582
2583 2019-06-05  Alex Christensen  <achristensen@webkit.org>
2584
2585         Introduce new SPI for context menus on iOS
2586         https://bugs.webkit.org/show_bug.cgi?id=198590
2587
2588         Reviewed by Tim Horton.
2589
2590         Also introduce WKContextMenuElementInfo which is API.
2591         This is part of <rdar://problem/51003503>
2592
2593         * Shared/API/APIObject.h:
2594         * Shared/API/Cocoa/WebKit.h:
2595         * Shared/Cocoa/APIObject.mm:
2596         (API::Object::newObject):
2597         * Sources.txt:
2598         * SourcesCocoa.txt:
2599         * UIProcess/API/APIContextMenuElementInfo.cpp: Added.
2600         (API::ContextMenuElementInfo::ContextMenuElementInfo):
2601         * UIProcess/API/APIContextMenuElementInfo.h: Added.
2602         * UIProcess/API/Cocoa/WKContextMenuElementInfo.h: Added.
2603         * UIProcess/API/Cocoa/WKContextMenuElementInfo.mm: Added.
2604         (-[WKContextMenuElementInfo linkURL]):
2605         (-[WKContextMenuElementInfo _apiObject]):
2606         (-[WKContextMenuElementInfo _activatedElementInfo]):
2607         * UIProcess/API/Cocoa/WKContextMenuElementInfoInternal.h: Added.
2608         * UIProcess/API/Cocoa/WKContextMenuElementInfoPrivate.h: Added.
2609         * UIProcess/API/Cocoa/WKPreviewElementInfo.h:
2610         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2611         * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
2612         * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
2613         (-[_WKActivatedElementInfo _initWithInteractionInformationAtPosition:]):
2614         (-[_WKActivatedElementInfo isAnimatedImage]):
2615         * UIProcess/ios/WKActionSheetAssistant.h:
2616         * UIProcess/ios/WKActionSheetAssistant.mm:
2617         (-[WKActionSheetAssistant defaultActionsForLinkSheet:]):
2618         (-[WKActionSheetAssistant defaultActionsForImageSheet:]):
2619         * UIProcess/ios/WKContentView.h:
2620         * UIProcess/ios/WKContentViewInteraction.mm:
2621         * WebKit.xcodeproj/project.pbxproj:
2622
2623 2019-06-07  Antoine Quint  <graouts@apple.com>
2624
2625         Restrict fast clicks everywhere to desktop content mode
2626         https://bugs.webkit.org/show_bug.cgi?id=198610
2627         <rdar://problem/50114230>
2628
2629         Reviewed by Dean Jackson.
2630
2631         We now set a new allowsFastClicksEverywhere property on the WebPageProxy when the content mode changes, set to true
2632         when we're in desktop browsing mode. We now check on this property to opt into the fast clicks everywhere behavior.
2633
2634         This patch had been reverted once because it yielded some regressions in existing tests, notably under
2635         fast/events/touch/ios/content-observation. This updated patch addresses this by ensuring the gesture recognizers
2636         used for double-tap-to-zoom are disabled in -[WKContentViewInteraction _didStartProvisionalLoadForMainFrame]
2637         to ensure that two tests dispatching a tap at the same location don't yield the recognition of a double-tap
2638         rathern than the recognition of two single taps. 
2639
2640         * UIProcess/WebPageProxy.h:
2641         (WebKit::WebPageProxy::allowsFastClicksEverywhere const):
2642         * UIProcess/ios/WKContentViewInteraction.mm:
2643         (-[WKContentView _handleSmartMagnificationInformationForPotentialTap:renderRect:fitEntireRect:viewportMinimumScale:viewportMaximumScale:]):
2644         (_didStartProvisionalLoadForMainFrame):
2645         * UIProcess/ios/WebPageProxyIOS.mm:
2646         (WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):
2647
2648 2019-06-07  Brent Fulgham  <bfulgham@apple.com>
2649
2650         [iOS] Update sandboxes to address iokit-get-property errors
2651         https://bugs.webkit.org/show_bug.cgi?id=198494
2652         <rdar://problem/51322072> and <rdar://problem/50602737>
2653
2654         Reviewed by Per Arne Vollan.
2655
2656         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2657
2658 2019-06-07  Andy Estes  <aestes@apple.com>
2659
2660         process-swap-on-navigation error when loading blocked website on iOS 12.2 only.
2661         https://bugs.webkit.org/show_bug.cgi?id=196930
2662         <rdar://problem/47819301>
2663
2664         Reviewed by Chris Dumez.
2665
2666         The ContentFilterDidBlockLoadForFrame message needs to be handled by ProvisionalPageProxy in
2667         order to look up the blocked frame in the correct WebProcessProxy.
2668
2669         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2670         (WebKit::WebPageProxy::contentFilterDidBlockLoadForFrame):
2671         (WebKit::WebPageProxy::contentFilterDidBlockLoadForFrameShared):
2672         * UIProcess/ProvisionalPageProxy.cpp:
2673         (WebKit::ProvisionalPageProxy::contentFilterDidBlockLoadForFrame):
2674         (WebKit::ProvisionalPageProxy::didReceiveMessage):
2675         * UIProcess/ProvisionalPageProxy.h:
2676         * UIProcess/WebPageProxy.h:
2677
2678 2019-06-07  Carlos Garcia Campos  <cgarcia@igalia.com>
2679
2680         Unreviewed. Fix api used to release wpe_fdo_egl_exported_image in GTK
2681
2682         We are using the old deprecated API in AcceleratedBackingStoreWayland::displayBuffer().
2683
2684         * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
2685         (WebKit::AcceleratedBackingStoreWayland::displayBuffer):
2686
2687 2019-06-06  Carlos Garcia Campos  <cgarcia@igalia.com>
2688
2689         REGRESSION(r243094): [GTK][WPE] Stale content after restoring the web view session
2690         https://bugs.webkit.org/show_bug.cgi?id=198561
2691
2692         Reviewed by Chris Dumez.
2693
2694         This is another regression of delaying the web process launch until the first load. If the session is restored
2695         before anything has been loaded, which is the normal way, the RestoreSession message is just ignored and the
2696         state is sent to the WebPage on creation via creation parameters. The WebPage considers that restoring a session
2697         from creation parameters only happens when re-launching a process after a crash or in case of process swap. In
2698         those cases, the history item is not marked as restored from session. We need to ensure the session is restored
2699         in the web process from the IPC message handler, by launching the initial process before the session is
2700         restored.
2701
2702         * UIProcess/WebPageProxy.cpp:
2703         (WebKit::WebPageProxy::restoreFromSessionState):
2704
2705 2019-06-06  Youenn Fablet  <youenn@apple.com>
2706
2707         Use an enumeration in UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo callback
2708         https://bugs.webkit.org/show_bug.cgi?id=198548
2709
2710         Reviewed by Eric Carlson.
2711
2712         Move from an Optional<bool> to an enum having three values to ease readability.
2713
2714         * UIProcess/UserMediaPermissionCheckProxy.cpp:
2715         (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo):
2716         (WebKit::UserMediaPermissionCheckProxy::complete):
2717         * UIProcess/UserMediaPermissionCheckProxy.h:
2718         (WebKit::UserMediaPermissionCheckProxy::invalidate):
2719         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2720         (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
2721         (WebKit::UserMediaPermissionRequestManagerProxy::startProcessingUserMediaPermissionRequest):
2722         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
2723         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
2724         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2725
2726 2019-06-06  Youenn Fablet  <youenn@apple.com>
2727
2728         Allow WebKitTestRunner to terminate network process after it finishes service worker file operations
2729         https://bugs.webkit.org/show_bug.cgi?id=198584
2730
2731         Reviewed by Geoffrey Garen.
2732
2733         Add IPC binding to new internal API.
2734
2735         * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in:
2736         * WebProcess/Storage/WebSWClientConnection.cpp:
2737         (WebKit::WebSWClientConnection::storeRegistrationsOnDiskForTesting):
2738         * WebProcess/Storage/WebSWClientConnection.h:
2739
2740 2019-06-06  Commit Queue  <commit-queue@webkit.org>
2741
2742         Unreviewed, rolling out r246165.
2743         https://bugs.webkit.org/show_bug.cgi?id=198636
2744
2745         Causing test failures in 7 content-observation tests.
2746         (Requested by ShawnRoberts on #webkit).
2747
2748         Reverted changeset:
2749
2750         "Restrict fast clicks everywhere to desktop content mode"
2751         https://bugs.webkit.org/show_bug.cgi?id=198610
2752         https://trac.webkit.org/changeset/246165
2753
2754 2019-06-06  Commit Queue  <commit-queue@webkit.org>
2755
2756         Unreviewed, rolling out r246123.
2757         https://bugs.webkit.org/show_bug.cgi?id=198634
2758
2759         Causes test failures (Requested by ShawnRoberts on #webkit).
2760
2761         Reverted changeset:
2762
2763         "[iOS] Update sandboxes to address iokit-get-property errors"
2764         https://bugs.webkit.org/show_bug.cgi?id=198494
2765         https://trac.webkit.org/changeset/246123
2766
2767 2019-06-06  Geoffrey Garen  <ggaren@apple.com>
2768
2769         Crash using WKHTTPCookieStore when you use WKWebView and UIWebView in the same app
2770         https://bugs.webkit.org/show_bug.cgi?id=198622
2771
2772         Reviewed by Chris Dumez.
2773
2774         Today in a WWDC lab, I saw some crash reports from an app that mixed
2775         WKWebView and UIWebView. The proximate cause of the crash is that
2776         WKHTTPCookieStore queues a callOnMainThread function, and then
2777         UIWebView dequeues it on the WebThread.
2778
2779         No test because this crash depends on mixing WKWebView and UIWebView and
2780         getting (un)lucky on the timing.
2781
2782         * UIProcess/API/APIHTTPCookieStore.cpp:
2783         (API::HTTPCookieStore::cookies):
2784         (API::HTTPCookieStore::setCookies):
2785         (API::HTTPCookieStore::deleteCookie): Avoid using callOnMainThread
2786         becuase it is prohibited in the UI process.
2787
2788 2019-06-06  Antoine Quint  <graouts@apple.com>
2789
2790         Remove duplicated websiteDataStoreParameters code from WebsitePoliciesData::applyToDocumentLoader()
2791         https://bugs.webkit.org/show_bug.cgi?id=198608
2792
2793         Reviewed by Wenson Hsieh.
2794
2795         Due to a rebasing error, r244218 re-introduced code that was removed in r244197. This patch removes this code for good.
2796
2797         * Shared/WebsitePoliciesData.cpp:
2798         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
2799
2800 2019-06-06  Antoine Quint  <graouts@apple.com>
2801
2802         Restrict fast clicks everywhere to desktop content mode
2803         https://bugs.webkit.org/show_bug.cgi?id=198610
2804         <rdar://problem/50114230>
2805
2806         Reviewed by Dean Jackson.
2807
2808         * UIProcess/WebPageProxy.h:
2809         (WebKit::WebPageProxy::allowsFastClicksEverywhere const):
2810         * UIProcess/ios/WKContentViewInteraction.mm:
2811         (-[WKContentView _handleSmartMagnificationInformationForPotentialTap:renderRect:fitEntireRect:viewportMinimumScale:viewportMaximumScale:]):
2812         * UIProcess/ios/WebPageProxyIOS.mm:
2813         (WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):
2814
2815 2019-06-06  Sihui Liu  <sihui_liu@apple.com>
2816
2817         NetworkHTTPSUpgradeChecker should construct and destruct database on the background thread
2818         https://bugs.webkit.org/show_bug.cgi?id=198496
2819
2820         Reviewed by Chris Dumez.
2821
2822         * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
2823         (WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker):
2824         (WebKit::NetworkHTTPSUpgradeChecker::~NetworkHTTPSUpgradeChecker):
2825         * NetworkProcess/NetworkHTTPSUpgradeChecker.h:
2826
2827 2019-06-06  Truitt Savell  <tsavell@apple.com>
2828
2829         Unreviewed, rolling out r246137.
2830
2831         Broke internal builds.
2832
2833         Reverted changeset:
2834
2835         "Introduce new SPI for context menus on iOS"
2836         https://bugs.webkit.org/show_bug.cgi?id=198590
2837         https://trac.webkit.org/changeset/246137
2838
2839 2019-06-06  Antti Koivisto  <antti@apple.com>
2840
2841         Position fixed is buggy with overflow:auto scrolling inside iframes
2842         https://bugs.webkit.org/show_bug.cgi?id=154399
2843         <rdar://problem/24742251>
2844
2845         Reviewed by Frederic Wang and Simon Fraser.
2846
2847         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
2848         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2849
2850         Remove viewportChangedViaDelegatedScrolling call as we were just relying on its side effect of (partially) applying
2851         the scrolling tree. Instead call the new applyScrollingTreeLayerPositionsAfterCommit() unconditionally.
2852         It only does work if there are local deltas to apply.
2853
2854         Local deltas will potentially need to be applied in non-fixed cases too and it is hard to reason about the conditions.
2855
2856         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
2857         (WebKit::RemoteScrollingCoordinatorProxy::applyScrollingTreeLayerPositionsAfterCommit):
2858         (WebKit::RemoteScrollingCoordinatorProxy::applyScrollingTreeLayerPositions): Deleted.
2859         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
2860
2861 2019-06-06  Michael Catanzaro  <mcatanzaro@igalia.com>
2862
2863         [WPE][GTK] Clean up use of initiatingPageID in implementation of webkit_uri_scheme_request_get_web_view()
2864         https://bugs.webkit.org/show_bug.cgi?id=198564
2865
2866         Reviewed by Carlos Garcia Campos.
2867
2868         Note that we have to use RefPtr rather than Ref here because the priv struct has to remain
2869         default-constructible.
2870
2871         * UIProcess/API/glib/WebKitURISchemeRequest.cpp:
2872         (webkitURISchemeRequestCreate):
2873         (webkit_uri_scheme_request_get_web_view):
2874
2875 2019-06-06  Carlos Garcia Campos  <cgarcia@igalia.com>
2876
2877         [GTK][WPE] Enable PSON
2878         https://bugs.webkit.org/show_bug.cgi?id=194979
2879
2880         Reviewed by Žan Doberšek.
2881
2882         * Shared/WebPreferencesDefaultValues.h:
2883
2884 2019-06-05  Said Abou-Hallawa  <sabouhallawa@apple.com>
2885
2886         [Cocoa] REGRESSION(r244182): Inspector thinks CA commits can be nested
2887         https://bugs.webkit.org/show_bug.cgi?id=198497
2888
2889         Reviewed by Simon Fraser.
2890
2891         Call InspectorController::willComposite() from the CA preCommit handler
2892         similar to the call to InspectorController::didComposite() in the CA
2893         postCommit handler. Ensure these calls will be once for nested commits.
2894
2895         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
2896         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
2897         (WebKit::RemoteLayerTreeDrawingArea::addCommitHandlers):
2898         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
2899         * WebProcess/WebPage/WebPage.h:
2900         (WebKit::WebPage::firstFlushAfterCommit const):
2901         (WebKit::WebPage::setFirstFlushAfterCommit):
2902         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2903         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2904         (WebKit::TiledCoreAnimationDrawingArea::addCommitHandlers):
2905         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
2906
2907 2019-06-05  Alex Christensen  <achristensen@webkit.org>
2908
2909         Introduce new SPI for context menus on iOS
2910         https://bugs.webkit.org/show_bug.cgi?id=198590
2911
2912         Reviewed by Tim Horton.
2913
2914         Also introduce WKContextMenuElementInfo which is API.
2915         This is part of <rdar://problem/51003503>
2916
2917         * Shared/API/APIObject.h:
2918         * Shared/API/Cocoa/WebKit.h:
2919         * Shared/Cocoa/APIObject.mm:
2920         (API::Object::newObject):
2921         * Sources.txt:
2922         * SourcesCocoa.txt:
2923         * UIProcess/API/APIContextMenuElementInfo.cpp: Added.
2924         (API::ContextMenuElementInfo::ContextMenuElementInfo):
2925         * UIProcess/API/APIContextMenuElementInfo.h: Added.
2926         * UIProcess/API/Cocoa/WKContextMenuElementInfo.h: Added.
2927         * UIProcess/API/Cocoa/WKContextMenuElementInfo.mm: Added.
2928         (-[WKContextMenuElementInfo linkURL]):
2929         (-[WKContextMenuElementInfo _apiObject]):
2930         (-[WKContextMenuElementInfo _activatedElementInfo]):
2931         * UIProcess/API/Cocoa/WKContextMenuElementInfoInternal.h: Added.
2932         * UIProcess/API/Cocoa/WKContextMenuElementInfoPrivate.h: Added.
2933         * UIProcess/API/Cocoa/WKPreviewElementInfo.h:
2934         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2935         * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
2936         * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
2937         (-[_WKActivatedElementInfo _initWithInteractionInformationAtPosition:]):
2938         (-[_WKActivatedElementInfo isAnimatedImage]):
2939         * UIProcess/ios/WKActionSheetAssistant.h:
2940         * UIProcess/ios/WKActionSheetAssistant.mm:
2941         (-[WKActionSheetAssistant defaultActionsForLinkSheet:]):
2942         (-[WKActionSheetAssistant defaultActionsForImageSheet:]):
2943         * UIProcess/ios/WKContentView.h:
2944         * UIProcess/ios/WKContentViewInteraction.mm:
2945         * WebKit.xcodeproj/project.pbxproj:
2946
2947 2019-06-05  Jer Noble  <jer.noble@apple.com>
2948
2949         -[WKWebView _suspendAllMediaPlayback] does not persist across navigation.
2950         https://bugs.webkit.org/show_bug.cgi?id=198585
2951
2952         Reviewed by Chris Dumez.
2953
2954         Add a new WebPageCreationParameters entry for mediaPlaybackIsSuspended, and pass
2955         that value across during WebPage creation.
2956
2957         * Shared/WebPageCreationParameters.cpp:
2958         (WebKit::WebPageCreationParameters::encode const):
2959         (WebKit::WebPageCreationParameters::decode):
2960         * Shared/WebPageCreationParameters.h:
2961         * UIProcess/WebPageProxy.cpp:
2962         (WebKit::WebPageProxy::suspendAllMediaPlayback):
2963         (WebKit::WebPageProxy::resumeAllMediaPlayback):
2964         (WebKit::WebPageProxy::creationParameters):
2965         * UIProcess/WebPageProxy.h:
2966         * WebProcess/WebPage/WebPage.cpp:
2967         (WebKit::WebPage):
2968
2969 2019-06-05  Sihui Liu  <sihui_liu@apple.com>
2970
2971         TestWebKitAPI.WKWebView.LocalStorageProcessSuspends is flaky on release builds
2972         https://bugs.webkit.org/show_bug.cgi?id=198582
2973
2974         Reviewed by Youenn Fablet.
2975
2976         Initialize the state of StorageManager.
2977
2978         * NetworkProcess/WebStorage/StorageManager.h:
2979
2980 2019-06-05  Alex Christensen  <achristensen@webkit.org>
2981
2982         Re-enable safe browsing in WKWebView
2983         https://bugs.webkit.org/show_bug.cgi?id=196161
2984         <rdar://problem/49171413>
2985
2986         Reviewed by Ryosuke Niwa.
2987
2988         This is mostly just reverting r241728.
2989
2990         * Shared/WebPreferences.yaml:
2991         * UIProcess/API/Cocoa/WKPreferences.h:
2992         * UIProcess/API/Cocoa/WKPreferences.mm:
2993         (-[WKPreferences setSafeBrowsingEnabled:]):
2994         (-[WKPreferences isSafeBrowsingEnabled]):
2995
2996 2019-06-05  Alex Christensen  <achristensen@webkit.org>
2997
2998         Progress towards resurrecting Mac CMake build
2999         https://bugs.webkit.org/show_bug.cgi?id=197132
3000
3001         Reviewed by Don Olmstead.
3002
3003         * PlatformMac.cmake:
3004
3005 2019-06-05  Youenn Fablet  <youenn@apple.com>
3006
3007         Remove logSiteIdentifier from UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame
3008         https://bugs.webkit.org/show_bug.cgi?id=198575
3009
3010         Reviewed by Eric Carlson.
3011
3012         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3013         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
3014
3015 == Rolled over to ChangeLog-2019-06-05 ==