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