Implement ScrollableArea::scrollOffset()
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-06-16  Simon Fraser  <simon.fraser@apple.com>
2
3         Implement ScrollableArea::scrollOffset()
4         https://bugs.webkit.org/show_bug.cgi?id=198895
5
6         Reviewed by Antti Koivisto.
7
8         * UIProcess/win/WebPopupMenuProxyWin.cpp:
9         (WebKit::PopupMenuWin::scrollPosition const):
10         (WebKit::WebPopupMenuProxyWin::onKeyDown): Just use m_scrollOffset.
11         (WebKit::WebPopupMenuProxyWin::scrollSize const): Deleted.
12         * UIProcess/win/WebPopupMenuProxyWin.h: Remove the one-axis scrollOffset()
13         * WebProcess/Plugins/PDF/PDFPlugin.h:
14         * WebProcess/Plugins/PDF/PDFPlugin.mm:
15         (WebKit::PDFPlugin::scrollSize const): Deleted.
16         (WebKit::PDFPlugin::scrollOffset const): Deleted.
17         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
18         (WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
19
20 2019-06-15  Youenn Fablet  <youenn@apple.com>
21
22         WebProcessPool::clearWebProcessHasUploads cannot assume its given processIdentifier is valid
23         https://bugs.webkit.org/show_bug.cgi?id=198865
24
25         Unreviewed.
26
27         * UIProcess/WebProcessPool.cpp:
28         (WebKit::WebProcessPool::clearWebProcessHasUploads):
29         Remove wrong debug assertion in case of WebProcessProxy destruction.
30
31 2019-06-15  Ludovico de Nittis  <ludovico.denittis@collabora.com>
32
33         [GTK] Stop accessing GdkEvent fields when possible
34         https://bugs.webkit.org/show_bug.cgi?id=198829
35
36         Reviewed by Michael Catanzaro.
37
38         Direct access to GdkEvent structs is no longer possible in GTK 4.
39
40         * Shared/gtk/WebEventFactory.cpp:
41         (WebKit::buttonForEvent):
42         (WebKit::WebEventFactory::createWebMouseEvent):
43         (WebKit::WebEventFactory::createWebWheelEvent):
44         (WebKit::WebEventFactory::createWebKeyboardEvent):
45         (WebKit::WebEventFactory::createWebTouchEvent):
46         * UIProcess/API/gtk/WebKitEmojiChooser.cpp:
47         * UIProcess/API/gtk/WebKitScriptDialogImpl.cpp:
48         (webkitScriptDialogImplKeyPressEvent):
49         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
50         (ClickCounter::currentClickCountForGdkButtonEvent):
51         (webkitWebViewBaseKeyPressEvent):
52         (webkitWebViewBaseHandleMouseEvent):
53         (webkitWebViewBaseCrossingNotifyEvent):
54         (webkitWebViewBaseGetTouchPointsForEvent):
55         (webkitWebViewBaseTouchEvent):
56         (webkitWebViewBaseEvent):
57         * UIProcess/gtk/GestureController.cpp:
58         (WebKit::GestureController::handleEvent):
59         * UIProcess/gtk/InputMethodFilter.cpp:
60         (WebKit::InputMethodFilter::filterKeyEvent):
61         (WebKit::InputMethodFilter::logHandleKeyboardEventForTesting):
62         (WebKit::InputMethodFilter::logHandleKeyboardEventWithCompositionResultsForTesting):
63         * UIProcess/gtk/KeyBindingTranslator.cpp:
64         (WebKit::KeyBindingTranslator::commandsForKeyEvent):
65         * UIProcess/gtk/ViewGestureControllerGtk.cpp:
66         (WebKit::isEventStop):
67         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanInfluenceSwipe):
68         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventGetScrollingDeltas):
69         (WebKit::ViewGestureController::SwipeProgressTracker::handleEvent):
70         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
71         (WebKit::WebPopupMenuProxyGtk::treeViewButtonReleaseEventCallback):
72         (WebKit::WebPopupMenuProxyGtk::keyPressEventCallback):
73
74 2019-06-15  Rob Buis  <rbuis@igalia.com>
75
76         Store prefetch redirects in the prefetch cache
77         https://bugs.webkit.org/show_bug.cgi?id=197371
78
79         Reviewed by Youenn Fablet.
80
81         Store prefetch redirects in the prefetch cache and use them when
82         navigating.
83
84         * NetworkProcess/NetworkResourceLoader.cpp:
85         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
86         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
87         (WebKit::NetworkResourceLoader::didFinishWithRedirectResponse):
88         * NetworkProcess/NetworkResourceLoader.h:
89         * NetworkProcess/cache/PrefetchCache.cpp:
90         (WebKit::PrefetchCache::Entry::Entry):
91         (WebKit::PrefetchCache::storeRedirect):
92         * NetworkProcess/cache/PrefetchCache.h:
93
94 2019-06-14  Devin Rousso  <drousso@apple.com>
95
96         waitForNavigationToComplete may be called before WebPageProxy knows it's loading
97         https://bugs.webkit.org/show_bug.cgi?id=198741
98         <rdar://problem/31164316>
99
100         Reviewed by Joseph Pecoraro.
101
102         There's a potential race in `WebAutomationSession::waitForNavigationToCompleteOnPage` when
103         querying for the `WebPageProxy`'s loading state (via `PageLoadingState::isLoading`), in that
104         a pending load may be committed _after_ the `WebAutomationSession` checks it's value. This
105         makes the automation session think that it isn't loading, so it will continue running
106         commands, which can lead to a JavaScript error ("Callback was not called before the unload
107         event") as any injected scripts will be cleared by the impending navigation, leaving the
108         script evaluation callbacks "dangling".
109
110         Expose more information from `PageLoadState` about whether it thinks there _may_ be a
111         navigation currently happening, which the `WebAutomationSession` can use to delay commands.
112
113         In the best case, no navigations are "missed".
114
115         In the worst case, the automation session will wait `pageLoadTimeout` before continuing.
116
117         * UIProcess/Automation/WebAutomationSession.cpp:
118         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage):
119
120         * UIProcess/PageLoadState.h:
121         * UIProcess/PageLoadState.cpp:
122         (WebKit::PageLoadState::hasUncommittedLoad const): Added.
123
124 2019-06-14  Youenn Fablet  <youenn@apple.com>
125
126         WebProcessPool::clearWebProcessHasUploads cannot assume its given processIdentifier is valid
127         https://bugs.webkit.org/show_bug.cgi?id=198865
128         <rdar://problem/51618878>
129
130         Reviewed by Brady Eidson.
131
132         NetworkProcess currently instructs UIProcess whether a given WebProcess is doing upload.
133         There is no guarantee though that the WebProcessProxy is still there when the IPC is arriving at UIProcess.
134         Instead, let WebProcess handles its upload state and notify WebProcessPool about its state.
135         Make sure WebProcessProxy unregisters itself in case of crash.
136         In case of NetworkProcess crash, WebProcesses will see all their uploads fail
137         and will notify automatically UIProcess to update their state.
138
139         Since the processID given to WebProcessPool is coming from IPC, we cannot not trust it.
140         Add early return in case of not finding a WebProcessProxy for WebProcessPool clear/set methods.
141
142         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
143         (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
144         * NetworkProcess/NetworkConnectionToWebProcess.h:
145         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
146         * NetworkProcess/NetworkResourceLoadMap.cpp:
147         (WebKit::NetworkResourceLoadMap::add):
148         (WebKit::NetworkResourceLoadMap::take):
149         * NetworkProcess/NetworkResourceLoadMap.h:
150         * UIProcess/WebProcessPool.cpp:
151         (WebKit::WebProcessPool::setWebProcessHasUploads):
152         (WebKit::WebProcessPool::clearWebProcessHasUploads):
153         * UIProcess/WebProcessProxy.cpp:
154         (WebKit::WebProcessProxy::~WebProcessProxy):
155         * WebProcess/Network/WebLoaderStrategy.cpp:
156         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
157         (WebKit::WebLoaderStrategy::remove):
158         (WebKit::WebLoaderStrategy::tryLoadingSynchronouslyUsingURLSchemeHandler):
159         * WebProcess/Network/WebLoaderStrategy.h:
160         * WebProcess/WebProcess.cpp:
161         (WebKit::WebProcess::ensureNetworkProcessConnection):
162
163 2019-06-14  Youenn Fablet  <youenn@apple.com>
164
165         WebResourceLoadStatisticsStore should not use its network session if invalidated
166         https://bugs.webkit.org/show_bug.cgi?id=198814
167
168         Reviewed by Geoffrey Garen.
169
170         Tell WebResourceLoadStatisticsStore that its network session is invalidated.
171         WebResourceLoadStatisticsStore will then clear its reference to the network session.
172
173         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
174         (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking):
175         Added for test purposes to trigger further cookie processing.
176         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
177         (WebKit::WebResourceLoadStatisticsStore::invalidateAndCancel):
178         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
179         * NetworkProcess/NetworkSession.cpp:
180         (WebKit::NetworkSession::invalidateAndCancel):
181
182 2019-06-14  Joseph Pecoraro  <pecoraro@apple.com>
183
184         [Cocoa] NSFileWrapper associated with _WKAttachment
185         https://bugs.webkit.org/show_bug.cgi?id=198871
186         <rdar://problem/51760625>
187
188         Reviewed by Wenson Hsieh.
189
190         * UIProcess/API/Cocoa/_WKAttachment.mm:
191         (-[_WKAttachment dealloc]):
192         Ensure we destruct the API::Object associated with this so RetainPtrs can release.
193
194 2019-06-14  Tim Horton  <timothy_horton@apple.com>
195
196         WebKit's NSAttributedString.h is not included in the WebKit.h umbrella header
197         https://bugs.webkit.org/show_bug.cgi?id=198869
198         <rdar://problem/51754437>
199
200         Reviewed by Timothy Hatcher.
201
202         * Shared/API/Cocoa/WebKit.h:
203         Make the new API available to modularized clients and folks who just import WebKit.h
204
205 2019-06-14  Jiewen Tan  <jiewen_tan@apple.com>
206
207         Disable AppSSO for web processes and plugin processes
208         https://bugs.webkit.org/show_bug.cgi?id=198843
209         <rdar://problem/51642920>
210
211         Reviewed by Sam Weinig.
212
213         This patch moves the disabling of AppSSO from AuxiliaryProcess to PluginProcess
214         and WebProcess such that NetworkingProcess will not be affected.
215
216         * PluginProcess/mac/PluginProcessMac.mm:
217         (WebKit::PluginProcess::platformInitializePluginProcess):
218         * Shared/ios/AuxiliaryProcessIOS.mm:
219         (WebKit::AuxiliaryProcess::platformInitialize):
220         * Shared/mac/AuxiliaryProcessMac.mm:
221         (WebKit::AuxiliaryProcess::platformInitialize):
222         * WebProcess/cocoa/WebProcessCocoa.mm:
223         (WebKit::WebProcess::platformInitializeProcess):
224
225 2019-06-14  Megan Gardner  <megan_gardner@apple.com>
226
227         Move Synthetic Editing Commands to behind an experimental feature flag
228         https://bugs.webkit.org/show_bug.cgi?id=198842
229         <rdar://problem/50594700>
230
231         Reviewed by Simon Fraser.
232
233         Add a feature flag to gate synthetic editing commands.
234
235         * Shared/WebPreferences.yaml:
236         * WebProcess/WebPage/ios/WebPageIOS.mm:
237         (WebKit::WebPage::getFocusedElementInformation):
238
239 2019-06-13  Megan Gardner  <megan_gardner@apple.com>
240
241         Fix selection hang in Mail
242         https://bugs.webkit.org/show_bug.cgi?id=198845
243         <rdar://problem/51388180>
244
245         Reviewed by Tim Horton.
246
247         SelectionDidChange requires a selectionWillChange in order to keep things in line.
248
249         * UIProcess/ios/WKContentViewInteraction.mm:
250         (-[WKContentView _selectionChanged]):
251
252 2019-06-13  Tim Horton  <timothy_horton@apple.com>
253
254         No content shows up for WKWebView while locked even with _canShowWhileLocked is YES
255         https://bugs.webkit.org/show_bug.cgi?id=198819
256         <rdar://problem/51636240>
257
258         Reviewed by Simon Fraser.
259
260         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
261         (WebKit::WebPageProxy::didCreateContextForVisibilityPropagation):
262         * UIProcess/WebPageProxy.h:
263         (WebKit::WebPageProxy::contextIDForVisibilityPropagation const):
264         * UIProcess/WebPageProxy.messages.in:
265         * UIProcess/WebProcessProxy.h:
266         (WebKit::WebProcessProxy::contextIDForVisibilityPropagation): Deleted.
267         * UIProcess/WebProcessProxy.messages.in:
268         * UIProcess/ios/WKContentView.mm:
269         (-[WKContentView _setupVisibilityPropagationView]):
270         * UIProcess/ios/WebPageProxyIOS.mm:
271         (WebKit::WebPageProxy::didCreateContextForVisibilityPropagation): Deleted.
272         * UIProcess/ios/WebProcessProxyIOS.mm:
273         (WebKit::WebProcessProxy::didCreateContextForVisibilityPropagation): Deleted.
274         * WebProcess/WebPage/WebPage.cpp:
275         (WebKit::m_shrinkToFitContentTimer):
276         * WebProcess/WebPage/WebPage.h:
277         * WebProcess/WebProcess.h:
278         * WebProcess/cocoa/WebProcessCocoa.mm:
279         (WebKit::WebProcess::platformInitializeWebProcess):
280         Move the creation of the visibility propagation context to WebPage instead of WebProcess,
281         because canShowWhileLocked is per-page, not per-process.
282
283         Also, pass canShowWhileLocked into the context creation function for the visibility
284         propagation context, not just RemoteLayerTree contexts.
285
286 2019-06-13  Antoine Quint  <graouts@apple.com>
287
288         "display: contents" Content click does not trigger
289         https://bugs.webkit.org/show_bug.cgi?id=198559
290         <rdar://problem/51488524>
291
292         Reviewed by Antti Koivisto.
293
294         * WebProcess/WebPage/ios/WebPageIOS.mm:
295         (WebKit::WebPage::commitPotentialTap):
296
297 2019-06-13  Takashi Komori  <Takashi.Komori@sony.com>
298
299         [curl] Remove member objects of CurlRequest not to share by different threads.
300         https://bugs.webkit.org/show_bug.cgi?id=198747
301
302         Reviewed by Fujii Hironori.
303
304         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
305         (WebKit::NetworkDataTaskCurl::curlDidReceiveResponse):
306         (WebKit::NetworkDataTaskCurl::curlDidComplete):
307         (WebKit::NetworkDataTaskCurl::curlDidFailWithError):
308         * NetworkProcess/curl/NetworkDataTaskCurl.h:
309
310 2019-06-13  Zan Dobersek  <zdobersek@igalia.com>
311
312         [Nicosia] Add SceneIntegration
313         https://bugs.webkit.org/show_bug.cgi?id=198791
314
315         Reviewed by Carlos Garcia Campos.
316
317         Have the LayerTreeHost own the SceneIntegration object that's to be
318         associated with layers used inside the LayerTreeHost's scene. The
319         class now also inherits the SceneIntegration::Client interface, with the
320         requestUpdate() method scheduling a scene update in ThreadedCompositor.
321
322         CompositingCoordinator now retrieves the SceneIntegration object from
323         the LayerTreeHost instance and manages association to that object for
324         layers under the coordinator's control.
325
326         ThreadedCompositor class gets a new public updateScene() method that
327         schedules an update, enabling the SceneIntegration class to invoke
328         scene updates.
329
330         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
331         (WebKit::ThreadedCompositor::updateScene):
332         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
333         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
334         (WebKit::CompositingCoordinator::createGraphicsLayer):
335         (WebKit::CompositingCoordinator::detachLayer):
336         (WebKit::CompositingCoordinator::attachLayer):
337         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
338         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
339         (WebKit::LayerTreeHost::LayerTreeHost):
340         (WebKit::LayerTreeHost::sceneIntegration):
341         (WebKit::LayerTreeHost::requestUpdate):
342         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h:
343
344 2019-06-13  Ludovico de Nittis  <ludovico.denittis@collabora.com>
345
346         [GTK] gdk_display_get_device_manager and gdk_screen_get_width/height are deprecated
347         https://bugs.webkit.org/show_bug.cgi?id=198822
348
349         Reviewed by Carlos Garcia Campos.
350
351         GdkSeat and GdkRectangle should be used, respectively.
352
353         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
354         (WebKit::doMouseEvent):
355         (WebKit::doMotionEvent):
356         (WebKit::doKeyStrokeEvent):
357
358 2019-06-12  Antoine Quint  <graouts@apple.com>
359
360         Show the web page URL when sharing an AR model
361         https://bugs.webkit.org/show_bug.cgi?id=198812
362         <rdar://problem/48689498>
363
364         Reviewed by Dean Jackson.
365
366         * UIProcess/Cocoa/DownloadClient.mm:
367         (WebKit::DownloadClient::didStart):
368         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
369         (-[_WKPreviewControllerDataSource initWithMIMEType:originatingPageURL:]):
370         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
371         (WebKit::SystemPreviewController::start):
372         (-[_WKPreviewControllerDataSource initWithMIMEType:]): Deleted.
373         * UIProcess/SystemPreviewController.h:
374
375 2019-06-12  Antti Koivisto  <antti@apple.com>
376
377         Try to fix iOS build.
378
379         * NetworkProcess/Downloads/DownloadMap.cpp:
380
381 2019-06-12  Youenn Fablet  <youenn@apple.com>
382
383         Use NSURLSession for WebSocket
384         https://bugs.webkit.org/show_bug.cgi?id=198568
385
386         Reviewed by Geoffrey Garen.
387
388         Implement socket channel provider on WebProcess level by sending IPC to NetworkProcess.
389         On NetworkProcess side, use NSURLSession API to implement the WebSocket functionality. 
390         This is a partial implementation:
391         - inspector integration is not working.
392         - some error cases are not well handled or are not producing the same error messages.
393         - some features are not implemented (extensions, subprotocols, handshake authentication challenge, cookie handling...).
394
395         * CMakeLists.txt:
396         * DerivedSources-input.xcfilelist:
397         * DerivedSources-output.xcfilelist:
398         * DerivedSources.make:
399         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
400         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
401         (WebKit::NetworkConnectionToWebProcess::createSocketChannel):
402         (WebKit::NetworkConnectionToWebProcess::removeSocketChannel):
403         * NetworkProcess/NetworkConnectionToWebProcess.h:
404         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
405         * NetworkProcess/NetworkSession.cpp:
406         (WebKit::NetworkSession::createWebSocketTask):
407         * NetworkProcess/NetworkSession.h:
408         (WebKit::NetworkSession::removeWebSocketTask):
409         (WebKit::NetworkSession::addWebSocketTask):
410         * NetworkProcess/NetworkSocketChannel.cpp: Added.
411         (WebKit::NetworkSocketChannel::create):
412         (WebKit::NetworkSocketChannel::NetworkSocketChannel):
413         (WebKit::NetworkSocketChannel::~NetworkSocketChannel):
414         (WebKit::NetworkSocketChannel::sendString):
415         (WebKit::NetworkSocketChannel::sendData):
416         (WebKit::NetworkSocketChannel::finishClosingIfPossible):
417         (WebKit::NetworkSocketChannel::close):
418         (WebKit::NetworkSocketChannel::didConnect):
419         (WebKit::NetworkSocketChannel::didReceiveText):
420         (WebKit::NetworkSocketChannel::didReceiveBinaryData):
421         (WebKit::NetworkSocketChannel::didClose):
422         (WebKit::NetworkSocketChannel::messageSenderConnection const):
423         * NetworkProcess/NetworkSocketChannel.h: Added.
424         * NetworkProcess/NetworkSocketChannel.messages.in: Added.
425         * NetworkProcess/NetworkSocketStream.messages.in:
426         * NetworkProcess/WebSocketTask.h: Added.
427         (WebKit::WebSocketTask::sendString):
428         (WebKit::WebSocketTask::sendData):
429         (WebKit::WebSocketTask::close):
430         (WebKit::WebSocketTask::cancel):
431         (WebKit::WebSocketTask::resume):
432         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
433         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
434         (-[WKNetworkSessionDelegate existingWebSocketTask:]):
435         (-[WKNetworkSessionDelegate URLSession:webSocketTask:didOpenWithProtocol:]):
436         (-[WKNetworkSessionDelegate URLSession:webSocketTask:didCloseWithCode:reason:]):
437         (WebKit::NetworkSessionCocoa::continueDidReceiveChallenge):
438         (WebKit::NetworkSessionCocoa::createWebSocketTask):
439         (WebKit::NetworkSessionCocoa::addWebSocketTask):
440         (WebKit::NetworkSessionCocoa::removeWebSocketTask):
441         (WebKit::NetworkSessionCocoa::webSocketDataTaskForIdentifier):
442         * NetworkProcess/cocoa/WebSocketTaskCocoa.h: Added.
443         * NetworkProcess/cocoa/WebSocketTaskCocoa.mm: Added.
444         (WebKit::WebSocketTask::WebSocketTask):
445         (WebKit::WebSocketTask::~WebSocketTask):
446         (WebKit::WebSocketTask::readNextMessage):
447         (WebKit::WebSocketTask::cancel):
448         (WebKit::WebSocketTask::resume):
449         (WebKit::WebSocketTask::didConnect):
450         (WebKit::WebSocketTask::didClose):
451         (WebKit::WebSocketTask::sendString):
452         (WebKit::WebSocketTask::sendData):
453         (WebKit::WebSocketTask::close):
454         (WebKit::WebSocketTask::identifier const):
455         * Shared/WebPreferences.yaml:
456         * WebKit.xcodeproj/project.pbxproj:
457         * WebProcess/Network/NetworkProcessConnection.cpp:
458         (WebKit::NetworkProcessConnection::didReceiveMessage):
459         * WebProcess/Network/WebSocketChannel.cpp: Added.
460         (WebKit::WebSocketChannel::create):
461         (WebKit::WebSocketChannel::WebSocketChannel):
462         (WebKit::WebSocketChannel::~WebSocketChannel):
463         (WebKit::WebSocketChannel::messageSenderConnection const):
464         (WebKit::WebSocketChannel::messageSenderDestinationID const):
465         (WebKit::WebSocketChannel::subprotocol):
466         (WebKit::WebSocketChannel::extensions):
467         (WebKit::WebSocketChannel::connect):
468         (WebKit::WebSocketChannel::send):
469         (WebKit::WebSocketChannel::bufferedAmount const):
470         (WebKit::WebSocketChannel::close):
471         (WebKit::WebSocketChannel::fail):
472         (WebKit::WebSocketChannel::disconnect):
473         (WebKit::WebSocketChannel::didConnect):
474         (WebKit::WebSocketChannel::didReceiveText):
475         (WebKit::WebSocketChannel::didReceiveBinaryData):
476         (WebKit::WebSocketChannel::didClose):
477         (WebKit::WebSocketChannel::didFail):
478         (WebKit::WebSocketChannel::networkProcessCrashed):
479         * WebProcess/Network/WebSocketChannel.h: Added.
480         * WebProcess/Network/WebSocketChannel.messages.in: Added.
481         * WebProcess/Network/WebSocketChannelManager.cpp: Added.
482         (WebKit::WebSocketChannelManager::createWebSocketChannel):
483         (WebKit::WebSocketChannelManager::networkProcessCrashed):
484         (WebKit::WebSocketChannelManager::didReceiveMessage):
485         * WebProcess/Network/WebSocketChannelManager.h: Added.
486         * WebProcess/Network/WebSocketProvider.cpp:
487         (WebKit::WebSocketProvider::createWebSocketChannel):
488         * WebProcess/Network/WebSocketProvider.h:
489         * WebProcess/Network/WebSocketStream.cpp:
490         * WebProcess/Network/WebSocketStream.messages.in:
491         * WebProcess/WebProcess.cpp:
492         (WebKit::WebProcess::networkProcessConnectionClosed):
493         * WebProcess/WebProcess.h:
494         (WebKit::WebProcess::webSocketChannelManager):
495
496 2019-06-12  Sihui Liu  <sihui_liu@apple.com>
497
498         Add assertions to help debug crash at WebKit::HistoryEntryDataEncoder::operator<<
499         https://bugs.webkit.org/show_bug.cgi?id=198766
500
501         Reviewed by Geoffrey Garen.
502
503         * Shared/SessionState.h:
504         (WebKit::FrameState::~FrameState):
505         * UIProcess/API/C/WKPage.cpp:
506         (WKPageCopySessionState):
507         * UIProcess/mac/LegacySessionStateCoding.cpp:
508         (WebKit::HistoryEntryDataEncoder::encodeFixedLengthData):
509         (WebKit::encodeFrameStateNode):
510
511 2019-06-12  Ludovico de Nittis  <ludovico.denittis@collabora.com>
512
513         [GTK] GTK_STOCK_* types have been deprecated since GTK 3.10
514         https://bugs.webkit.org/show_bug.cgi?id=198787
515
516         Reviewed by Michael Catanzaro.
517
518         We completely remove the gtkStockIDFromContextMenuAction function in order to get rid of the stock items.
519         This function was used only in "createActionIfNeeded" where now we pass a nullptr as a stock_id variable.
520
521         * Shared/glib/WebContextMenuItemGlib.cpp:
522         (WebKit::gtkStockIDFromContextMenuAction):
523
524 2019-06-12  Brent Fulgham  <bfulgham@apple.com>
525
526         Unreviewed fix after rr246360.
527
528         The current code accidentally calls the completion handler twice.
529
530         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
531         (-[WKWebsiteDataStore _setPrevalentDomain:completionHandler:]):
532
533 2019-06-12  Jiewen Tan  <jiewen_tan@apple.com>
534
535         REGRESSION (r245043) [Mac WK2 Debug] ASSERTION FAILED: m_services.isEmpty() && transports.size() <= maxTransportNumber seen with two http/wpt/webauthn/public-key-credential-* tests
536         https://bugs.webkit.org/show_bug.cgi?id=197917
537         <rdar://problem/51524958>
538
539         Reviewed by Brent Fulgham.
540
541         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.
542         Therefore, when the new request starts discovery, it will still see previous request's state.
543
544         To fix this issue, clearState() will be called unconditionally for every request. And a guard is added to clearState() to prevent double clearance.
545
546         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
547         (WebKit::AuthenticatorManager::makeCredential):
548         (WebKit::AuthenticatorManager::getAssertion):
549         (WebKit::AuthenticatorManager::clearState):
550
551 2019-06-12  Brent Fulgham  <bfulgham@apple.com>
552
553         Add mechanism and test case to check if ITP is active
554         https://bugs.webkit.org/show_bug.cgi?id=198694
555         <rdar://problem/51557704>
556
557         Reviewed by Youenn Fablet.
558
559         Add a new private SPI call on the WebsiteDataStore object that allows test code
560         to mark a domain as prevalent, and check the prevalance of a resource. This
561         is then used to build a test to confirm ITP is active and working.
562
563         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
564         (-[WKWebsiteDataStore _setPrevalentDomain:completionHandler:]):
565         (-[WKWebsiteDataStore _getIsPrevalentDomain:completionHandler:]):
566         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
567
568 2019-06-12  Wenson Hsieh  <wenson_hsieh@apple.com>
569
570         Many layout tests are failing on iPad simulator due to unexpected viewport dimensions
571         https://bugs.webkit.org/show_bug.cgi?id=198789
572         <rdar://problem/51595519>
573
574         Reviewed by Simon Fraser.
575
576         Prevent the shrink-to-fit-content timer from activating on layout tests that use the testing viewport
577         configuration.
578
579         * WebProcess/WebPage/ios/WebPageIOS.mm:
580         (WebKit::WebPage::immediatelyShrinkToFitContent):
581
582 2019-06-12  Michael Catanzaro  <mcatanzaro@igalia.com>
583
584         [WPE][GTK] Deprecate WebSQL APIs
585         https://bugs.webkit.org/show_bug.cgi?id=195011
586
587         Reviewed by Carlos Garcia Campos.
588
589         * UIProcess/API/glib/WebKitSettings.cpp:
590         (webkit_settings_class_init):
591         * UIProcess/API/glib/WebKitWebContext.cpp:
592         (webkitWebContextConstructed):
593         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
594         (webkitWebsiteDataManagerGetProperty):
595         (webkit_website_data_manager_class_init):
596         * UIProcess/API/gtk/WebKitWebsiteData.h:
597         * UIProcess/API/gtk/WebKitWebsiteDataManager.h:
598         * UIProcess/API/wpe/WebKitWebsiteData.h:
599         * UIProcess/API/wpe/WebKitWebsiteDataManager.h:
600
601 2019-06-12  Michael Catanzaro  <mcatanzaro@igalia.com>
602
603         [WPE][GTK] Enable hyperlink auditing
604         https://bugs.webkit.org/show_bug.cgi?id=197845
605
606         Reviewed by Carlos Garcia Campos.
607
608         * UIProcess/API/glib/WebKitSettings.cpp:
609         (webkit_settings_class_init):
610
611 2019-06-12  Ludovico de Nittis  <ludovico.denittis@collabora.com>
612
613         [GTK] gtk_misc_set_alignment is deprecated since GTK 3.14
614         https://bugs.webkit.org/show_bug.cgi?id=198785
615
616         Reviewed by Carlos Garcia Campos.
617
618         Replace the deprecated gtk_misc_set_alignment with halign and valign.
619
620         * UIProcess/API/gtk/WebKitAuthenticationDialog.cpp:
621         (createLabelWithLineWrap):
622
623 2019-06-11  Wenson Hsieh  <wenson_hsieh@apple.com>
624
625         [iOS] Idempotent text autosizing needs to react properly to viewport changes
626         https://bugs.webkit.org/show_bug.cgi?id=198736
627         <rdar://problem/50591911>
628
629         Reviewed by Zalan Bujtas.
630
631         If idempotent text autosizing is enabled, respond to viewport initial scale changes by forcing a style recalc,
632         since the amount by which idempotent text autosizing boosts font sizes depends on the Page's initial scale.
633
634         * WebProcess/WebPage/WebPage.h:
635         * WebProcess/WebPage/ios/WebPageIOS.mm:
636         (WebKit::WebPage::resetIdempotentTextAutosizingIfNeeded):
637         (WebKit::WebPage::viewportConfigurationChanged):
638
639 2019-06-11  Zalan Bujtas  <zalan@apple.com>
640
641         LayoutTests/fast/events/touch/ios/double-tap-for-double-click* test cases are failing
642         https://bugs.webkit.org/show_bug.cgi?id=198764
643         <rdar://problem/51035459>
644
645         Reviewed by Wenson Hsieh.
646
647         This patch replaces the existing, _doubleTapGestureRecognizerForDoubleClick based double click handling with a WebProcess based implementation using
648         the potentialTapAtPosition/commitPotentialTap infrastructure.
649
650         * Shared/WebPageCreationParameters.cpp:
651         (WebKit::WebPageCreationParameters::encode const):
652         (WebKit::WebPageCreationParameters::decode):
653         * Shared/WebPageCreationParameters.h:
654         * UIProcess/PageClient.h:
655         * UIProcess/WebPageProxy.cpp:
656         (WebKit::WebPageProxy::creationParameters):
657         * UIProcess/WebPageProxy.h:
658         * UIProcess/ios/PageClientImplIOS.h:
659         * UIProcess/ios/PageClientImplIOS.mm:
660         (WebKit::PageClientImpl::doubleTapForDoubleClickDelay):
661         (WebKit::PageClientImpl::doubleTapForDoubleClickRadius):
662         * UIProcess/ios/WKContentViewInteraction.h:
663         * UIProcess/ios/WKContentViewInteraction.mm:
664         (-[WKContentView _ensureNonBlockingDoubleTapGestureRecognizer]):
665         (-[WKContentView setupInteraction]):
666         (-[WKContentView cleanupInteraction]):
667         (-[WKContentView _removeDefaultGestureRecognizers]):
668         (-[WKContentView _addDefaultGestureRecognizers]):
669         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
670         (-[WKContentView gestureRecognizerShouldBegin:]):
671         (-[WKContentView _didStartProvisionalLoadForMainFrame]):
672         (-[WKContentView _doubleTapForDoubleClickDelay]):
673         (-[WKContentView _doubleTapForDoubleClickRadius]):
674         (-[WKContentView _doubleTapRecognizedForDoubleClick:]): Deleted.
675         * UIProcess/ios/WebPageProxyIOS.mm:
676         (WebKit::WebPageProxy::handleDoubleTapForDoubleClickAtPoint): Deleted.
677         * WebProcess/WebPage/WebPage.cpp:
678         * WebProcess/WebPage/WebPage.h:
679         * WebProcess/WebPage/WebPage.messages.in:
680         * WebProcess/WebPage/ios/WebPageIOS.mm:
681         (WebKit::WebPage::handlePotentialDoubleTapForDoubleClickAtPoint):
682         (WebKit::WebPage::commitPotentialTap):
683         (WebKit::WebPage::handleDoubleTapForDoubleClickAtPoint): Deleted.
684
685 2019-06-11  Andy Estes  <aestes@apple.com>
686
687         [Apple Pay] ASSERTION FAILED: m_state == State::Activating under WebPaymentCoordinatorProxy::showPaymentUI
688         https://bugs.webkit.org/show_bug.cgi?id=198776
689         <rdar://problem/49123795>
690
691         Reviewed by Brian Weinstein.
692
693         It's possible that an active session is aborted before the completion handler passed to
694         platformShowPaymentUI() has executed. When that happens, m_state will be Idle even though we
695         assert that it is Activating. Fix this by returning early in the platformShowPaymentUI()
696         completion handler when m_state is Idle.
697
698         It's not possible to write a layout test for this because MockPaymentCoordinator handles
699         showing payment UI directly in the web process, so this code is not executed in layout
700         tests. The assertion can be reproduced manually by loading
701         https://w3c-test.org/payment-request/payment-is-showing.https.html and clicking the button.
702
703         * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
704         (WebKit::WebPaymentCoordinatorProxy::showPaymentUI):
705
706 2019-06-11  Patrick Griffis  <pgriffis@igalia.com>
707
708         [GTK] Fix a11y support in bubblewrap sandbox
709         https://bugs.webkit.org/show_bug.cgi?id=198777
710
711         Reviewed by Michael Catanzaro.
712
713         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
714         (WebKit::bindA11y):
715
716 2019-06-11  Timothy Hatcher  <timothy@apple.com>
717
718         Flash when tapping compose button after switching to/from dark mode without restarting Mail.
719         https://bugs.webkit.org/show_bug.cgi?id=198769
720         rdar://problem/51370037
721
722         Reviewed by Tim Horton.
723
724         Accessing a dynamic color outside a normal UIView choke point without setting
725         UITraitCollection.currentTraitCollection first can cause undefined results.
726         Use LocalCurrentTraitCollection inside scrollViewBackgroundColor when accessing
727         the dynamic system UIColors. Also use systemBackgroundColor instead of white.
728
729         * UIProcess/API/Cocoa/WKWebView.mm:
730         (scrollViewBackgroundColor):
731
732 2019-06-11  Megan Gardner  <megan_gardner@apple.com>
733
734         Integrate scrollbar gestures for iOS
735         https://bugs.webkit.org/show_bug.cgi?id=198767
736
737         Reviewed by Tim Horton.
738
739         * UIProcess/ios/WKContentViewInteraction.mm:
740         (_WKGestureRecognizerIsBuiltInScrollViewGestureRecognizer):
741         (-[WKContentView gestureRecognizer:canPreventGestureRecognizer:]):
742
743 2019-06-11  Timothy Hatcher  <timothy@apple.com>
744
745         Scrollbar can show as white on white in dark mode on iOS.
746         https://bugs.webkit.org/show_bug.cgi?id=198772
747         rdar://problem/51516743
748
749         Reviewed by Tim Horton.
750
751         * UIProcess/API/Cocoa/WKWebView.mm:
752         (-[WKWebView _updateScrollViewBackground]): Use UIScrollViewIndicatorStyleBlack instead
753         of UIScrollViewIndicatorStyleDefault to prevent getting a white scrollbar in dark mode.
754
755 2019-06-11  Michael Catanzaro  <mcatanzaro@igalia.com>
756
757         Unreviewed build warning fixes
758
759         Silence -Wunused-variable warning
760
761         * UIProcess/WebProcessPool.cpp:
762         (WebKit::WebProcessPool::clearWebProcessIsPlayingAudibleMedia):
763
764 2019-06-11  Simon Fraser  <simon.fraser@apple.com>
765
766         Fix non-internal builds after r246327.
767
768         * Platform/spi/ios/UIKitSPI.h:
769
770 2019-06-10  Simon Fraser  <simon.fraser@apple.com>
771
772         Add logging for UI-side compositing hit-testing
773         https://bugs.webkit.org/show_bug.cgi?id=198739
774
775         Reviewed by Antti Koivisto.
776
777         Make it easier to debug UI-side compositing hit-testing issues with a UIHitTesting log
778         channel, which logs information about the UIView hierarchy, which views are found by
779         hit-testing, and what touch-actions apply.
780
781         This log channel can be set by passing the argument '-WebKit2Logging "UIHitTesting"' when
782         launching a debug iOS MobileSafari instance.
783
784         * Platform/Logging.h:
785         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
786         (-[UIView _web_findDescendantViewAtPoint:withEvent:]):
787         * UIProcess/ios/WKContentViewInteraction.mm:
788         (-[WKContentView hitTest:withEvent:]):
789         (-[WKContentView _handleTouchActionsForTouchEvent:]):
790
791 2019-06-11  Antti Koivisto  <antti@apple.com>
792
793         REGRESSION (iOS): Can't scroll litter-robot.com checkout form's dropdown menus
794         https://bugs.webkit.org/show_bug.cgi?id=198753
795         <rdar://problem/51355686>
796
797         Reviewed by Simon Fraser.
798
799         If an element with 'overflow:scroll' also had 'visibility:hidden' or 'pointer-events:none' it would
800         capture touches and prevent scrolling of any overlapped scrollers.
801
802         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
803         (WebKit::collectDescendantViewsAtPoint):
804
805         Filter out views with 'isUserInteractionEnabled == NO' (set for hidden and pointer-events:none layers).
806         This prevents it being considered as the first view hit when determining scrolling relationships.
807
808         (-[UIView _web_findDescendantViewAtPoint:withEvent:]):
809
810         No need to skip here anymore.
811
812 2019-06-11  Wenson Hsieh  <wenson_hsieh@apple.com>
813
814         Quotes are always inserted as smart quotes on stackblitz.com, causing compilation errors
815         https://bugs.webkit.org/show_bug.cgi?id=198735
816         <rdar://problem/51557159>
817
818         Reviewed by Megan Gardner.
819
820         Add a flag in FocusedElementInformation to indicate whether spellchecking is allowed in the focused element.
821         If spellchecking is not allowed, then disable smart quotes and dashes, which matches behavior on macOS.
822
823         * Shared/FocusedElementInformation.cpp:
824         (WebKit::FocusedElementInformation::encode const):
825         (WebKit::FocusedElementInformation::decode):
826         * Shared/FocusedElementInformation.h:
827         * UIProcess/ios/WKContentViewInteraction.mm:
828         (-[WKContentView textInputTraits]):
829         * WebProcess/WebPage/ios/WebPageIOS.mm:
830         (WebKit::WebPage::getFocusedElementInformation):
831
832 2019-06-11  Carlos Garcia Campos  <cgarcia@igalia.com>
833
834         [GTK] Remove option REDIRECTED_XCOMPOSITE_WINDOW
835         https://bugs.webkit.org/show_bug.cgi?id=198748
836
837         Reviewed by Žan Doberšek.
838
839         It's unused and untested, we kept that code path only because the redirected window caused performance issues in
840         some drivers in embedded devices. Nowadays there are much better solutions for those cases like using WPE port
841         or GTK port under wayland instead of X11.
842
843         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
844         (WebKit::ThreadedCompositor::create): Remove the ShouldDoFrameSync parameter since it always receives Yes.
845         (WebKit::ThreadedCompositor::ThreadedCompositor): Ditto.
846         (WebKit::ThreadedCompositor::createGLContext): Remove the code to handle the case of ShouldDoFrameSync being No,
847         since it's always Yes.
848         (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing): Deleted.
849         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
850         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
851         (webkitWebViewBaseRealize): Remove the code for !USE(REDIRECTED_XCOMPOSITE_WINDOW).
852         (webkitWebViewBaseUnrealize): Ditto.
853         (webkitWebViewBaseDraw): acceleratedBackingStore member can't be nullptr now.
854         (webkitWebViewBaseEnterAcceleratedCompositingMode): Ditto.
855         (webkitWebViewBaseUpdateAcceleratedCompositingMode): Ditto.
856         (webkitWebViewBaseExitAcceleratedCompositingMode): Ditto.
857         (webkitWebViewBaseMakeGLContextCurrent): Ditto.
858         (webkitWebViewBaseDidRelaunchWebProcess): Remove the code for !USE(REDIRECTED_XCOMPOSITE_WINDOW).
859         (webkitWebViewBasePageClosed): Ditto.
860         (webkitWebViewBaseRenderHostFileDescriptor): acceleratedBackingStore member can't be nullptr now.
861         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
862         (WebKit::DrawingAreaProxyCoordinatedGraphics::didUpdateBackingStoreState): Remove the code for !USE(REDIRECTED_XCOMPOSITE_WINDOW).
863         (WebKit::DrawingAreaProxyCoordinatedGraphics::setNativeSurfaceHandleForCompositing): Deleted.
864         (WebKit::DrawingAreaProxyCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing): Deleted.
865         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h:
866         * UIProcess/gtk/AcceleratedBackingStore.cpp:
867         (WebKit::AcceleratedBackingStore::create): Add an assert to ensure we create an AcceleratedBackingStore.
868         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
869         * UIProcess/gtk/AcceleratedBackingStoreX11.h:
870         * UIProcess/gtk/HardwareAccelerationManager.cpp:
871         (WebKit::HardwareAccelerationManager::HardwareAccelerationManager): Remove the code for !USE(REDIRECTED_XCOMPOSITE_WINDOW).
872         * WebProcess/WebPage/AcceleratedSurface.cpp:
873         (WebKit::AcceleratedSurface::create): Add an assert to ensure we create an AcceleratedSurface.
874         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
875         (WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode): Remove the code for !USE(REDIRECTED_XCOMPOSITE_WINDOW).
876         (WebKit::DrawingAreaCoordinatedGraphics::setNativeSurfaceHandleForCompositing): Deleted.
877         (WebKit::DrawingAreaCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing): Deleted.
878         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h:
879         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
880         (WebKit::LayerTreeHost::LayerTreeHost): m_surface can't be nullptr now.
881         (WebKit::LayerTreeHost::sizeDidChange): Ditto.
882         (WebKit::LayerTreeHost::deviceOrPageScaleFactorChanged): Ditto.
883         (WebKit::LayerTreeHost::nativeSurfaceHandleForCompositing): Ditto.
884         (WebKit::LayerTreeHost::didDestroyGLContext): Ditto.
885         (WebKit::LayerTreeHost::willRenderFrame): Ditto.
886         (WebKit::LayerTreeHost::didRenderFrame): Ditto.
887         (WebKit::LayerTreeHost::setNativeSurfaceHandleForCompositing): Deleted.
888         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h:
889         * WebProcess/WebPage/DrawingArea.h:
890         * WebProcess/WebPage/DrawingArea.messages.in:
891         * WebProcess/WebPage/WebPage.h:
892         (WebKit::WebPage::nativeWindowHandle): Deleted.
893         * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.cpp:
894         * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.h:
895
896 2019-06-11  Michael Catanzaro  <mcatanzaro@igalia.com>
897
898         [WPE][GTK] bubblewrap sandbox should grant access to web extensions directory
899         https://bugs.webkit.org/show_bug.cgi?id=198734
900
901         Reviewed by Carlos Garcia Campos.
902
903         * UIProcess/API/glib/WebKitWebContext.cpp:
904         (webkit_web_context_set_web_extensions_directory):
905
906 2019-06-10  Andy Estes  <aestes@apple.com>
907
908         [iOS] Use PDFKit SPI for taking snapshots when the hosting app is not entitled for global capture
909         https://bugs.webkit.org/show_bug.cgi?id=198731
910         <rdar://problem/46215174>
911
912         Reviewed by Tim Horton.
913
914         PDFHostViewController renders PDF contents in a view service, and apps are unable to
915         snapshot views rendered out-of-process without an entitlement.
916
917         When an app is missing this entitlement and calls WKWebView's
918         takeSnapshotWithConfiguration: API when a PDF is displayed, fall back to calling
919         PDFHostViewController's snapshotting SPI.
920
921         Testing is blocked by <https://webkit.org/b/175204>.
922
923         * Platform/spi/ios/PDFKitSPI.h:
924         * UIProcess/API/Cocoa/WKWebView.mm:
925         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
926         * UIProcess/Cocoa/WKWebViewContentProvider.h:
927         * UIProcess/ios/WKPDFView.mm:
928         (+[WKPDFView web_requiresCustomSnapshotting]):
929         (-[WKPDFView web_snapshotRectInContentViewCoordinates:snapshotWidth:completionHandler:]):
930         * UIProcess/ios/WKSystemPreviewView.mm:
931         (+[WKSystemPreviewView web_requiresCustomSnapshotting]):
932
933 2019-06-10  Sam Weinig  <weinig@apple.com>
934
935         Remove Dashboard support
936         https://bugs.webkit.org/show_bug.cgi?id=198615
937
938         Reviewed by Ryosuke Niwa.
939
940         * Configurations/FeatureDefines.xcconfig:
941         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
942         (WKBundleSetUseDashboardCompatibilityMode): Deleted.
943         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
944         * WebProcess/InjectedBundle/InjectedBundle.cpp:
945         (WebKit::InjectedBundle::setUseDashboardCompatibilityMode): Deleted.
946         * WebProcess/InjectedBundle/InjectedBundle.h:
947         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
948         (WebKit::WebChromeClient::annotatedRegionsChanged): Deleted.
949         * WebProcess/WebCoreSupport/WebChromeClient.h:
950
951 2019-06-10  Wenson Hsieh  <wenson_hsieh@apple.com>
952
953         [iOS] fast/xsl tests are flaky when run after certain viewport shrink-to-fit tests
954         https://bugs.webkit.org/show_bug.cgi?id=198699
955         <rdar://problem/50501718>
956
957         Reviewed by Simon Fraser.
958
959         Lift logic that sets the "IsKnownToLayOutWiderThanViewport" flag out of resetViewportDefaultConfiguration, and
960         into didCommitLoad instead (along with other logic for resetting viewport arguments). The previous method,
961         resetViewportDefaultConfiguration, was being triggered very frequently undo didReceiveMobileDocType, causing the
962         shrink-to-fit heuristic to sometimes take no effect. The original intention here was simply to reset the flag
963         upon page load.
964
965         * WebProcess/WebPage/WebPage.cpp:
966         (WebKit::WebPage::didCommitLoad):
967         * WebProcess/WebPage/ios/WebPageIOS.mm:
968         (WebKit::WebPage::resetViewportDefaultConfiguration):
969
970 2019-06-10  Timothy Hatcher  <timothy@apple.com>
971
972         Integrate dark mode support for iOS.
973         https://bugs.webkit.org/show_bug.cgi?id=198687
974         rdar://problem/51545643
975
976         Reviewed by Tim Horton.
977
978         * Configurations/FeatureDefines.xcconfig:
979         * UIProcess/API/Cocoa/WKWebView.mm:
980         (-[WKWebView _effectiveAppearanceIsDark]):
981         (-[WKWebView _effectiveAppearanceIsInactive]):
982         (-[WKWebView _dynamicUserInterfaceTraitDidChange]):
983         * UIProcess/API/Cocoa/WKWebViewInternal.h:
984         * UIProcess/ios/PageClientImplIOS.h:
985         * UIProcess/ios/PageClientImplIOS.mm:
986         (WebKit::PageClientImpl::effectiveAppearanceIsDark const):
987         (WebKit::PageClientImpl::effectiveAppearanceIsInactive const):
988         * UIProcess/ios/WKPasswordView.mm:
989         (-[WKPasswordView showInScrollView:]):
990         (configureScrollView): Deleted.
991
992 2019-06-10  Sihui Liu  <sihui_liu@apple.com>
993
994         [WKHTTPCookieStore getAllCookies:] may return duplicate cookies
995         https://bugs.webkit.org/show_bug.cgi?id=198635
996         <rdar://problem/46010232>
997
998         Reviewed by Ryosuke Niwa.
999
1000         When there is no process pool, we store cookies set in memory with HashSet m_pendingCookies of WebsiteDataStore.
1001
1002         HashSet does not contain duplicate Cookies that are completely identical, but it may contain Cookies that have 
1003         all the other properties identical other than value. This is not correct because Cookies with same name, domain
1004         and path should be treated as the same cookie. When a cookie is set via API, we should either insert the 
1005         cookie into m_pendingCookies if the cookie does not exist, or update the cookie value if it already exists.
1006
1007         Note that we still use HashSet with CookieHash for m_pendingCookies because in cookie deletion, we only delete 
1008         cookie when there is a complete match. If some cookie from m_pendingCookies has all other properties the same as
1009         the cookie specified in the deletion function, but the value is different, it will not be removed.
1010
1011         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1012         (WebKit::WebsiteDataStore::addPendingCookie):
1013
1014 2019-06-10  Philippe Normand  <pnormand@igalia.com>
1015
1016         [WPE][Qt] Port to new wpe_fdo_egl_exported_image API
1017         https://bugs.webkit.org/show_bug.cgi?id=198713
1018
1019         Reviewed by Carlos Garcia Campos.
1020
1021         * UIProcess/API/wpe/qt/WPEQtViewBackend.cpp:
1022         (WPEQtViewBackend::WPEQtViewBackend):
1023         (WPEQtViewBackend::texture):
1024         (WPEQtViewBackend::displayImage):
1025         * UIProcess/API/wpe/qt/WPEQtViewBackend.h:
1026
1027 2019-06-09  Brent Fulgham  <bfulgham@apple.com>
1028
1029         [iOS] ResourceLoadStatistics state is not properly relayed to the NetworkProcess
1030         https://bugs.webkit.org/show_bug.cgi?id=198692
1031         <rdar://problem/51538088>
1032
1033         Reviewed by Maciej Stachowiak.
1034
1035         * UIProcess/WebProcessPool.cpp:
1036         (WebKit::WebProcessPool::setResourceLoadStatisticsEnabled): Message the NetworkProcess
1037         on state change.
1038
1039 2019-06-08  Dean Jackson  <dino@apple.com>
1040
1041         Drag starting state can get stuck even though the drag has ended
1042         https://bugs.webkit.org/show_bug.cgi?id=198696
1043         <rdar://problem/51556045>
1044
1045         Reviewed by Wenson Hsieh.
1046
1047         In iOS 13, we're seeing cases of the DragSession not
1048         correctly ending, and thus leaving m_isStartingDrag in
1049         an incorrect state. Temporarily force this to be reset
1050         in ::dragEnded while investigating
1051
1052         * UIProcess/ios/WKContentViewInteraction.mm: Add some more release logging
1053         while here.
1054         (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
1055         (-[WKContentView dragInteraction:item:willAnimateCancelWithAnimator:]):
1056         * WebProcess/WebPage/WebPage.cpp:
1057         (WebKit::WebPage::dragEnded):
1058
1059 2019-06-08  Wenson Hsieh  <wenson_hsieh@apple.com>
1060
1061         [iOS] The default application name for user agent when requesting desktop content is still "Mobile/15E148"
1062         https://bugs.webkit.org/show_bug.cgi?id=198693
1063         <rdar://problem/51555371>
1064
1065         Reviewed by Tim Horton.
1066
1067         Fixes the bug by introducing an applicationNameForDesktopUserAgent member to WebPageProxy. This
1068         applicationNameForDesktopUserAgent is set alongside the regular applicationNameForUserAgent; however, in the
1069         case where it is being set via WKWebViewConfiguration, use WKWebViewConfiguration's
1070         _applicationNameForDesktopUserAgent instead. See below for more details.
1071
1072         Tested by adding to the existing API test PreferredContentMode.ApplicationNameForDesktopUserAgent.
1073
1074         * UIProcess/API/APIWebsitePolicies.cpp:
1075         (API::WebsitePolicies::copy const):
1076         * UIProcess/API/APIWebsitePolicies.h:
1077
1078         Drive-by fix: rename applicationNameForUserAgentWithModernCompatibility to applicationNameForDesktopUserAgent in
1079         a few places.
1080
1081         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
1082         (-[WKBrowsingContextController setApplicationNameForUserAgent:]):
1083         * UIProcess/API/Cocoa/WKWebView.mm:
1084         (-[WKWebView _initializeWithConfiguration:]):
1085         (-[WKWebView _setApplicationNameForUserAgent:]):
1086         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1087
1088         Change _applicationNameForUserAgent into an Optional<RetainPtr<NSString>>. A value of WTF::nullopt allows us to
1089         know that the default application name should be used (which is different when requesting desktop content).
1090
1091         (-[WKWebViewConfiguration encodeWithCoder:]):
1092         (-[WKWebViewConfiguration initWithCoder:]):
1093         (-[WKWebViewConfiguration copyWithZone:]):
1094         (-[WKWebViewConfiguration _applicationNameForDesktopUserAgent]):
1095
1096         Add _applicationNameForDesktopUserAgent to the web view configuration. This behaves like
1097         applicationNameForUserAgent, with one exception: in the case where the default applicationNameForUserAgent is
1098         used (i.e. the client has not specified any application name), default to `nil` as the application name for user
1099         agent, rather than "Mobile/15E148".
1100
1101         (-[WKWebViewConfiguration applicationNameForUserAgent]):
1102         (-[WKWebViewConfiguration setApplicationNameForUserAgent:]):
1103         * UIProcess/API/Cocoa/WKWebViewConfigurationInternal.h:
1104         * UIProcess/API/Cocoa/WKWebpagePreferences.mm:
1105         (-[WKWebpagePreferences _applicationNameForUserAgentWithModernCompatibility]):
1106         (-[WKWebpagePreferences _setApplicationNameForUserAgentWithModernCompatibility:]):
1107         * UIProcess/WebPageProxy.h:
1108         (WebKit::WebPageProxy::setApplicationNameForDesktopUserAgent):
1109         (WebKit::WebPageProxy::applicationNameForDesktopUserAgent const):
1110         * UIProcess/ios/WebPageProxyIOS.mm:
1111         (WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):
1112
1113 2019-06-08  Andy Estes  <aestes@apple.com>
1114
1115         [Apple Pay] If we have a bound interface identifier, set it on new PKPaymentRequests
1116         https://bugs.webkit.org/show_bug.cgi?id=198690
1117         <rdar://problem/48041803>
1118
1119         Reviewed by Tim Horton.
1120
1121         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
1122         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1123         (WebKit::NetworkSessionCocoa::boundInterfaceIdentifier const): Implemented a public getter
1124         for m_boundInterfaceIdentifier.
1125
1126         * NetworkProcess/NetworkConnectionToWebProcess.h:
1127         * NetworkProcess/ios/NetworkConnectionToWebProcessIOS.mm:
1128         (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorBoundInterfaceIdentifier):
1129         Implemented an override for paymentCoordinatorBoundInterfaceIdentifier.
1130
1131         * Shared/ApplePay/WebPaymentCoordinatorProxy.h: Declared
1132         paymentCoordinatorBoundInterfaceIdentifier for clients to override.
1133
1134         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1135         (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): If the client has a non-empty
1136         bound interface identifier, set it on the new PKPaymentRequest.
1137
1138         * UIProcess/WebPageProxy.h:
1139         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
1140         (WebKit::WebPageProxy::paymentCoordinatorBoundInterfaceIdentifier): Implemented an override
1141         for paymentCoordinatorBoundInterfaceIdentifier.
1142
1143 2019-06-07  Antti Koivisto  <antti@apple.com>
1144
1145         REGRESSION (r245006): Setting scrollview.scrollEnabled clobbers any scrollEnabled set by a client
1146         https://bugs.webkit.org/show_bug.cgi?id=198656
1147         <rdar://problem/51494585>
1148
1149         Reviewed by Tim Horton.
1150
1151         Allow client to disable scrolling and zooming.
1152
1153         * UIProcess/API/Cocoa/WKWebView.mm:
1154         (-[WKWebView _didCommitLayerTree:]):
1155         * UIProcess/ios/WKScrollView.h:
1156         * UIProcess/ios/WKScrollView.mm:
1157         (-[WKScrollView initWithFrame:]):
1158         (-[WKScrollView setScrollEnabled:]):
1159         (-[WKScrollView _setScrollEnabledInternal:]):
1160         (-[WKScrollView _updateScrollability]):
1161         (-[WKScrollView setZoomEnabled:]):
1162         (-[WKScrollView _setZoomEnabledInternal:]):
1163         (-[WKScrollView _updateZoomability]):
1164
1165 2019-06-07  Wenson Hsieh  <wenson_hsieh@apple.com>
1166
1167         Allow clients to vend custom -inputView and -inputAccessoryView by overriding WKWebView methods
1168         https://bugs.webkit.org/show_bug.cgi?id=198631
1169         <rdar://problem/51505431>
1170
1171         Reviewed by Tim Horton.
1172
1173         Allow WKWebView API clients to override WKContentView's default input view and/or input accessory view by
1174         subclassing WKWebView and implementing -inputView or -inputAccessoryView.
1175
1176         * UIProcess/API/Cocoa/WKWebView.mm:
1177         (-[WKWebView inputAccessoryView]):
1178         (-[WKWebView inputView]):
1179         * UIProcess/ios/WKContentViewInteraction.h:
1180         * UIProcess/ios/WKContentViewInteraction.mm:
1181         (-[WKContentView inputView]):
1182         (-[WKContentView inputViewForWebView]):
1183         (-[WKContentView inputAccessoryView]):
1184         (-[WKContentView inputAccessoryViewForWebView]):
1185
1186 2019-06-07  Tim Horton  <timothy_horton@apple.com>
1187
1188         Disable focus rings on WKContentView for PLATFORM(IOSMAC)
1189         https://bugs.webkit.org/show_bug.cgi?id=198685
1190
1191         Reviewed by Simon Fraser.
1192
1193         * Platform/spi/ios/UIKitSPI.h:
1194         * UIProcess/ios/WKContentView.mm:
1195         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
1196
1197 2019-06-07  Megan Gardner  <megan_gardner@apple.com>
1198
1199         Extend quirks to emulate bold/italic/underline in hidden editable areas
1200         https://bugs.webkit.org/show_bug.cgi?id=198681
1201
1202         Reviewed by Wenson Hsieh.
1203
1204         * Shared/FocusedElementInformation.cpp:
1205         (WebKit::FocusedElementInformation::encode const):
1206         (WebKit::FocusedElementInformation::decode):
1207         * Shared/FocusedElementInformation.h:
1208         * Shared/SyntheticEditingCommandType.h:
1209         * UIProcess/ios/WKContentView.mm:
1210         (-[WKContentView undoManager]):
1211         * UIProcess/ios/WKContentViewInteraction.mm:
1212         (shouldSynthezieKeyEvents):
1213         (-[WKContentView toggleBoldfaceForWebView:]):
1214         (-[WKContentView toggleItalicsForWebView:]):
1215         (-[WKContentView toggleUnderlineForWebView:]):
1216         (-[WKContentView _elementDidBlur]):
1217         * WebProcess/WebPage/ios/WebPageIOS.mm:
1218         (WebKit::WebPage::generateSyntheticEditingCommand):
1219         (WebKit::WebPage::getFocusedElementInformation):
1220
1221 2019-06-05  Alex Christensen  <achristensen@webkit.org>
1222
1223         Introduce new SPI for context menus on iOS
1224         https://bugs.webkit.org/show_bug.cgi?id=198590
1225
1226         Reviewed by Tim Horton.
1227
1228         Also introduce WKContextMenuElementInfo which is API.
1229         This is part of <rdar://problem/51003503>
1230
1231         * Shared/API/APIObject.h:
1232         * Shared/API/Cocoa/WebKit.h:
1233         * Shared/Cocoa/APIObject.mm:
1234         (API::Object::newObject):
1235         * Sources.txt:
1236         * SourcesCocoa.txt:
1237         * UIProcess/API/APIContextMenuElementInfo.cpp: Added.
1238         (API::ContextMenuElementInfo::ContextMenuElementInfo):
1239         * UIProcess/API/APIContextMenuElementInfo.h: Added.
1240         * UIProcess/API/Cocoa/WKContextMenuElementInfo.h: Added.
1241         * UIProcess/API/Cocoa/WKContextMenuElementInfo.mm: Added.
1242         (-[WKContextMenuElementInfo linkURL]):
1243         (-[WKContextMenuElementInfo _apiObject]):
1244         (-[WKContextMenuElementInfo _activatedElementInfo]):
1245         * UIProcess/API/Cocoa/WKContextMenuElementInfoInternal.h: Added.
1246         * UIProcess/API/Cocoa/WKContextMenuElementInfoPrivate.h: Added.
1247         * UIProcess/API/Cocoa/WKPreviewElementInfo.h:
1248         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1249         * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
1250         * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
1251         (-[_WKActivatedElementInfo _initWithInteractionInformationAtPosition:]):
1252         (-[_WKActivatedElementInfo isAnimatedImage]):
1253         * UIProcess/ios/WKActionSheetAssistant.h:
1254         * UIProcess/ios/WKActionSheetAssistant.mm:
1255         (-[WKActionSheetAssistant defaultActionsForLinkSheet:]):
1256         (-[WKActionSheetAssistant defaultActionsForImageSheet:]):
1257         * UIProcess/ios/WKContentView.h:
1258         * UIProcess/ios/WKContentViewInteraction.mm:
1259         * WebKit.xcodeproj/project.pbxproj:
1260
1261 2019-06-07  Antoine Quint  <graouts@apple.com>
1262
1263         Restrict fast clicks everywhere to desktop content mode
1264         https://bugs.webkit.org/show_bug.cgi?id=198610
1265         <rdar://problem/50114230>
1266
1267         Reviewed by Dean Jackson.
1268
1269         We now set a new allowsFastClicksEverywhere property on the WebPageProxy when the content mode changes, set to true
1270         when we're in desktop browsing mode. We now check on this property to opt into the fast clicks everywhere behavior.
1271
1272         This patch had been reverted once because it yielded some regressions in existing tests, notably under
1273         fast/events/touch/ios/content-observation. This updated patch addresses this by ensuring the gesture recognizers
1274         used for double-tap-to-zoom are disabled in -[WKContentViewInteraction _didStartProvisionalLoadForMainFrame]
1275         to ensure that two tests dispatching a tap at the same location don't yield the recognition of a double-tap
1276         rathern than the recognition of two single taps. 
1277
1278         * UIProcess/WebPageProxy.h:
1279         (WebKit::WebPageProxy::allowsFastClicksEverywhere const):
1280         * UIProcess/ios/WKContentViewInteraction.mm:
1281         (-[WKContentView _handleSmartMagnificationInformationForPotentialTap:renderRect:fitEntireRect:viewportMinimumScale:viewportMaximumScale:]):
1282         (_didStartProvisionalLoadForMainFrame):
1283         * UIProcess/ios/WebPageProxyIOS.mm:
1284         (WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):
1285
1286 2019-06-07  Brent Fulgham  <bfulgham@apple.com>
1287
1288         [iOS] Update sandboxes to address iokit-get-property errors
1289         https://bugs.webkit.org/show_bug.cgi?id=198494
1290         <rdar://problem/51322072> and <rdar://problem/50602737>
1291
1292         Reviewed by Per Arne Vollan.
1293
1294         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1295
1296 2019-06-07  Andy Estes  <aestes@apple.com>
1297
1298         process-swap-on-navigation error when loading blocked website on iOS 12.2 only.
1299         https://bugs.webkit.org/show_bug.cgi?id=196930
1300         <rdar://problem/47819301>
1301
1302         Reviewed by Chris Dumez.
1303
1304         The ContentFilterDidBlockLoadForFrame message needs to be handled by ProvisionalPageProxy in
1305         order to look up the blocked frame in the correct WebProcessProxy.
1306
1307         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
1308         (WebKit::WebPageProxy::contentFilterDidBlockLoadForFrame):
1309         (WebKit::WebPageProxy::contentFilterDidBlockLoadForFrameShared):
1310         * UIProcess/ProvisionalPageProxy.cpp:
1311         (WebKit::ProvisionalPageProxy::contentFilterDidBlockLoadForFrame):
1312         (WebKit::ProvisionalPageProxy::didReceiveMessage):
1313         * UIProcess/ProvisionalPageProxy.h:
1314         * UIProcess/WebPageProxy.h:
1315
1316 2019-06-07  Carlos Garcia Campos  <cgarcia@igalia.com>
1317
1318         Unreviewed. Fix api used to release wpe_fdo_egl_exported_image in GTK
1319
1320         We are using the old deprecated API in AcceleratedBackingStoreWayland::displayBuffer().
1321
1322         * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
1323         (WebKit::AcceleratedBackingStoreWayland::displayBuffer):
1324
1325 2019-06-06  Carlos Garcia Campos  <cgarcia@igalia.com>
1326
1327         REGRESSION(r243094): [GTK][WPE] Stale content after restoring the web view session
1328         https://bugs.webkit.org/show_bug.cgi?id=198561
1329
1330         Reviewed by Chris Dumez.
1331
1332         This is another regression of delaying the web process launch until the first load. If the session is restored
1333         before anything has been loaded, which is the normal way, the RestoreSession message is just ignored and the
1334         state is sent to the WebPage on creation via creation parameters. The WebPage considers that restoring a session
1335         from creation parameters only happens when re-launching a process after a crash or in case of process swap. In
1336         those cases, the history item is not marked as restored from session. We need to ensure the session is restored
1337         in the web process from the IPC message handler, by launching the initial process before the session is
1338         restored.
1339
1340         * UIProcess/WebPageProxy.cpp:
1341         (WebKit::WebPageProxy::restoreFromSessionState):
1342
1343 2019-06-06  Youenn Fablet  <youenn@apple.com>
1344
1345         Use an enumeration in UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo callback
1346         https://bugs.webkit.org/show_bug.cgi?id=198548
1347
1348         Reviewed by Eric Carlson.
1349
1350         Move from an Optional<bool> to an enum having three values to ease readability.
1351
1352         * UIProcess/UserMediaPermissionCheckProxy.cpp:
1353         (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo):
1354         (WebKit::UserMediaPermissionCheckProxy::complete):
1355         * UIProcess/UserMediaPermissionCheckProxy.h:
1356         (WebKit::UserMediaPermissionCheckProxy::invalidate):
1357         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1358         (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
1359         (WebKit::UserMediaPermissionRequestManagerProxy::startProcessingUserMediaPermissionRequest):
1360         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
1361         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
1362         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1363
1364 2019-06-06  Youenn Fablet  <youenn@apple.com>
1365
1366         Allow WebKitTestRunner to terminate network process after it finishes service worker file operations
1367         https://bugs.webkit.org/show_bug.cgi?id=198584
1368
1369         Reviewed by Geoffrey Garen.
1370
1371         Add IPC binding to new internal API.
1372
1373         * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in:
1374         * WebProcess/Storage/WebSWClientConnection.cpp:
1375         (WebKit::WebSWClientConnection::storeRegistrationsOnDiskForTesting):
1376         * WebProcess/Storage/WebSWClientConnection.h:
1377
1378 2019-06-06  Commit Queue  <commit-queue@webkit.org>
1379
1380         Unreviewed, rolling out r246165.
1381         https://bugs.webkit.org/show_bug.cgi?id=198636
1382
1383         Causing test failures in 7 content-observation tests.
1384         (Requested by ShawnRoberts on #webkit).
1385
1386         Reverted changeset:
1387
1388         "Restrict fast clicks everywhere to desktop content mode"
1389         https://bugs.webkit.org/show_bug.cgi?id=198610
1390         https://trac.webkit.org/changeset/246165
1391
1392 2019-06-06  Commit Queue  <commit-queue@webkit.org>
1393
1394         Unreviewed, rolling out r246123.
1395         https://bugs.webkit.org/show_bug.cgi?id=198634
1396
1397         Causes test failures (Requested by ShawnRoberts on #webkit).
1398
1399         Reverted changeset:
1400
1401         "[iOS] Update sandboxes to address iokit-get-property errors"
1402         https://bugs.webkit.org/show_bug.cgi?id=198494
1403         https://trac.webkit.org/changeset/246123
1404
1405 2019-06-06  Geoffrey Garen  <ggaren@apple.com>
1406
1407         Crash using WKHTTPCookieStore when you use WKWebView and UIWebView in the same app
1408         https://bugs.webkit.org/show_bug.cgi?id=198622
1409
1410         Reviewed by Chris Dumez.
1411
1412         Today in a WWDC lab, I saw some crash reports from an app that mixed
1413         WKWebView and UIWebView. The proximate cause of the crash is that
1414         WKHTTPCookieStore queues a callOnMainThread function, and then
1415         UIWebView dequeues it on the WebThread.
1416
1417         No test because this crash depends on mixing WKWebView and UIWebView and
1418         getting (un)lucky on the timing.
1419
1420         * UIProcess/API/APIHTTPCookieStore.cpp:
1421         (API::HTTPCookieStore::cookies):
1422         (API::HTTPCookieStore::setCookies):
1423         (API::HTTPCookieStore::deleteCookie): Avoid using callOnMainThread
1424         becuase it is prohibited in the UI process.
1425
1426 2019-06-06  Antoine Quint  <graouts@apple.com>
1427
1428         Remove duplicated websiteDataStoreParameters code from WebsitePoliciesData::applyToDocumentLoader()
1429         https://bugs.webkit.org/show_bug.cgi?id=198608
1430
1431         Reviewed by Wenson Hsieh.
1432
1433         Due to a rebasing error, r244218 re-introduced code that was removed in r244197. This patch removes this code for good.
1434
1435         * Shared/WebsitePoliciesData.cpp:
1436         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
1437
1438 2019-06-06  Antoine Quint  <graouts@apple.com>
1439
1440         Restrict fast clicks everywhere to desktop content mode
1441         https://bugs.webkit.org/show_bug.cgi?id=198610
1442         <rdar://problem/50114230>
1443
1444         Reviewed by Dean Jackson.
1445
1446         * UIProcess/WebPageProxy.h:
1447         (WebKit::WebPageProxy::allowsFastClicksEverywhere const):
1448         * UIProcess/ios/WKContentViewInteraction.mm:
1449         (-[WKContentView _handleSmartMagnificationInformationForPotentialTap:renderRect:fitEntireRect:viewportMinimumScale:viewportMaximumScale:]):
1450         * UIProcess/ios/WebPageProxyIOS.mm:
1451         (WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):
1452
1453 2019-06-06  Sihui Liu  <sihui_liu@apple.com>
1454
1455         NetworkHTTPSUpgradeChecker should construct and destruct database on the background thread
1456         https://bugs.webkit.org/show_bug.cgi?id=198496
1457
1458         Reviewed by Chris Dumez.
1459
1460         * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
1461         (WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker):
1462         (WebKit::NetworkHTTPSUpgradeChecker::~NetworkHTTPSUpgradeChecker):
1463         * NetworkProcess/NetworkHTTPSUpgradeChecker.h:
1464
1465 2019-06-06  Truitt Savell  <tsavell@apple.com>
1466
1467         Unreviewed, rolling out r246137.
1468
1469         Broke internal builds.
1470
1471         Reverted changeset:
1472
1473         "Introduce new SPI for context menus on iOS"
1474         https://bugs.webkit.org/show_bug.cgi?id=198590
1475         https://trac.webkit.org/changeset/246137
1476
1477 2019-06-06  Antti Koivisto  <antti@apple.com>
1478
1479         Position fixed is buggy with overflow:auto scrolling inside iframes
1480         https://bugs.webkit.org/show_bug.cgi?id=154399
1481         <rdar://problem/24742251>
1482
1483         Reviewed by Frederic Wang and Simon Fraser.
1484
1485         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
1486         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
1487
1488         Remove viewportChangedViaDelegatedScrolling call as we were just relying on its side effect of (partially) applying
1489         the scrolling tree. Instead call the new applyScrollingTreeLayerPositionsAfterCommit() unconditionally.
1490         It only does work if there are local deltas to apply.
1491
1492         Local deltas will potentially need to be applied in non-fixed cases too and it is hard to reason about the conditions.
1493
1494         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
1495         (WebKit::RemoteScrollingCoordinatorProxy::applyScrollingTreeLayerPositionsAfterCommit):
1496         (WebKit::RemoteScrollingCoordinatorProxy::applyScrollingTreeLayerPositions): Deleted.
1497         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
1498
1499 2019-06-06  Michael Catanzaro  <mcatanzaro@igalia.com>
1500
1501         [WPE][GTK] Clean up use of initiatingPageID in implementation of webkit_uri_scheme_request_get_web_view()
1502         https://bugs.webkit.org/show_bug.cgi?id=198564
1503
1504         Reviewed by Carlos Garcia Campos.
1505
1506         Note that we have to use RefPtr rather than Ref here because the priv struct has to remain
1507         default-constructible.
1508
1509         * UIProcess/API/glib/WebKitURISchemeRequest.cpp:
1510         (webkitURISchemeRequestCreate):
1511         (webkit_uri_scheme_request_get_web_view):
1512
1513 2019-06-06  Carlos Garcia Campos  <cgarcia@igalia.com>
1514
1515         [GTK][WPE] Enable PSON
1516         https://bugs.webkit.org/show_bug.cgi?id=194979
1517
1518         Reviewed by Žan Doberšek.
1519
1520         * Shared/WebPreferencesDefaultValues.h:
1521
1522 2019-06-05  Said Abou-Hallawa  <sabouhallawa@apple.com>
1523
1524         [Cocoa] REGRESSION(r244182): Inspector thinks CA commits can be nested
1525         https://bugs.webkit.org/show_bug.cgi?id=198497
1526
1527         Reviewed by Simon Fraser.
1528
1529         Call InspectorController::willComposite() from the CA preCommit handler
1530         similar to the call to InspectorController::didComposite() in the CA
1531         postCommit handler. Ensure these calls will be once for nested commits.
1532
1533         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
1534         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
1535         (WebKit::RemoteLayerTreeDrawingArea::addCommitHandlers):
1536         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
1537         * WebProcess/WebPage/WebPage.h:
1538         (WebKit::WebPage::firstFlushAfterCommit const):
1539         (WebKit::WebPage::setFirstFlushAfterCommit):
1540         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
1541         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1542         (WebKit::TiledCoreAnimationDrawingArea::addCommitHandlers):
1543         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
1544
1545 2019-06-05  Alex Christensen  <achristensen@webkit.org>
1546
1547         Introduce new SPI for context menus on iOS
1548         https://bugs.webkit.org/show_bug.cgi?id=198590
1549
1550         Reviewed by Tim Horton.
1551
1552         Also introduce WKContextMenuElementInfo which is API.
1553         This is part of <rdar://problem/51003503>
1554
1555         * Shared/API/APIObject.h:
1556         * Shared/API/Cocoa/WebKit.h:
1557         * Shared/Cocoa/APIObject.mm:
1558         (API::Object::newObject):
1559         * Sources.txt:
1560         * SourcesCocoa.txt:
1561         * UIProcess/API/APIContextMenuElementInfo.cpp: Added.
1562         (API::ContextMenuElementInfo::ContextMenuElementInfo):
1563         * UIProcess/API/APIContextMenuElementInfo.h: Added.
1564         * UIProcess/API/Cocoa/WKContextMenuElementInfo.h: Added.
1565         * UIProcess/API/Cocoa/WKContextMenuElementInfo.mm: Added.
1566         (-[WKContextMenuElementInfo linkURL]):
1567         (-[WKContextMenuElementInfo _apiObject]):
1568         (-[WKContextMenuElementInfo _activatedElementInfo]):
1569         * UIProcess/API/Cocoa/WKContextMenuElementInfoInternal.h: Added.
1570         * UIProcess/API/Cocoa/WKContextMenuElementInfoPrivate.h: Added.
1571         * UIProcess/API/Cocoa/WKPreviewElementInfo.h:
1572         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1573         * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
1574         * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
1575         (-[_WKActivatedElementInfo _initWithInteractionInformationAtPosition:]):
1576         (-[_WKActivatedElementInfo isAnimatedImage]):
1577         * UIProcess/ios/WKActionSheetAssistant.h:
1578         * UIProcess/ios/WKActionSheetAssistant.mm:
1579         (-[WKActionSheetAssistant defaultActionsForLinkSheet:]):
1580         (-[WKActionSheetAssistant defaultActionsForImageSheet:]):
1581         * UIProcess/ios/WKContentView.h:
1582         * UIProcess/ios/WKContentViewInteraction.mm:
1583         * WebKit.xcodeproj/project.pbxproj:
1584
1585 2019-06-05  Jer Noble  <jer.noble@apple.com>
1586
1587         -[WKWebView _suspendAllMediaPlayback] does not persist across navigation.
1588         https://bugs.webkit.org/show_bug.cgi?id=198585
1589
1590         Reviewed by Chris Dumez.
1591
1592         Add a new WebPageCreationParameters entry for mediaPlaybackIsSuspended, and pass
1593         that value across during WebPage creation.
1594
1595         * Shared/WebPageCreationParameters.cpp:
1596         (WebKit::WebPageCreationParameters::encode const):
1597         (WebKit::WebPageCreationParameters::decode):
1598         * Shared/WebPageCreationParameters.h:
1599         * UIProcess/WebPageProxy.cpp:
1600         (WebKit::WebPageProxy::suspendAllMediaPlayback):
1601         (WebKit::WebPageProxy::resumeAllMediaPlayback):
1602         (WebKit::WebPageProxy::creationParameters):
1603         * UIProcess/WebPageProxy.h:
1604         * WebProcess/WebPage/WebPage.cpp:
1605         (WebKit::WebPage):
1606
1607 2019-06-05  Sihui Liu  <sihui_liu@apple.com>
1608
1609         TestWebKitAPI.WKWebView.LocalStorageProcessSuspends is flaky on release builds
1610         https://bugs.webkit.org/show_bug.cgi?id=198582
1611
1612         Reviewed by Youenn Fablet.
1613
1614         Initialize the state of StorageManager.
1615
1616         * NetworkProcess/WebStorage/StorageManager.h:
1617
1618 2019-06-05  Alex Christensen  <achristensen@webkit.org>
1619
1620         Re-enable safe browsing in WKWebView
1621         https://bugs.webkit.org/show_bug.cgi?id=196161
1622         <rdar://problem/49171413>
1623
1624         Reviewed by Ryosuke Niwa.
1625
1626         This is mostly just reverting r241728.
1627
1628         * Shared/WebPreferences.yaml:
1629         * UIProcess/API/Cocoa/WKPreferences.h:
1630         * UIProcess/API/Cocoa/WKPreferences.mm:
1631         (-[WKPreferences setSafeBrowsingEnabled:]):
1632         (-[WKPreferences isSafeBrowsingEnabled]):
1633
1634 2019-06-05  Alex Christensen  <achristensen@webkit.org>
1635
1636         Progress towards resurrecting Mac CMake build
1637         https://bugs.webkit.org/show_bug.cgi?id=197132
1638
1639         Reviewed by Don Olmstead.
1640
1641         * PlatformMac.cmake:
1642
1643 2019-06-05  Youenn Fablet  <youenn@apple.com>
1644
1645         Remove logSiteIdentifier from UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame
1646         https://bugs.webkit.org/show_bug.cgi?id=198575
1647
1648         Reviewed by Eric Carlson.
1649
1650         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1651         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
1652
1653 == Rolled over to ChangeLog-2019-06-05 ==