130d555e26e459546e59d2e465697a06c7e73ddd
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-02-11  Daniel Bates  <dabates@apple.com>
2
3         [iOS] Mouse/Touch/Pointer events are missing modifier keys
4         https://bugs.webkit.org/show_bug.cgi?id=191446
5         <rdar://problem/45929460>
6
7         Reviewed by Tim Horton.
8
9         Make use of UIKit SPI to retreive the modifier flags when dispatching mouse and touch events.
10         Add new WebKit SPI for iOS, -[WKNavigationAction modifierFlags], to retrieve the the modifier
11         flags held when a navigation action was initiated.
12
13         * Platform/spi/ios/UIKitSPI.h: Expose SPI.
14         * Shared/NativeWebTouchEvent.h: Re-arrange macro guards so that we can expose the helper function
15         WebKit::webEventModifierFlags(). This is a bit more involved that usual since this header is included
16         from both C++ and Objective-C source files. It only makes sense to expose this function when
17         compiling as part of an Objective-C source file.
18         * Shared/ios/NativeWebTouchEventIOS.mm:
19         (WebKit::NativeWebTouchEvent::NativeWebTouchEvent): Modified to take the modifier flags held down
20         when the platform touch event was received and pass them through to the base constructor.
21         (WebKit::webEventModifierFlags): Added. Converts from the platform-speciifc UIKeyModifierFlags to
22         OptionSet<WebKit::WebEvent::Modifier>.
23         * Shared/ios/WebIOSEventFactory.h:
24         * Shared/ios/WebIOSEventFactory.mm:
25         (WebIOSEventFactory::toUIKeyModifierFlags): Added. Converts from OptionSet<WebKit::WebEvent::Modifier>
26         to the platform-specific UIKeyModifierFlags.
27         * UIProcess/API/Cocoa/WKNavigationAction.mm:
28         (-[WKNavigationAction modifierFlags]): Added.
29         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
30         * UIProcess/WebPageProxy.h:
31         * UIProcess/ios/WKContentViewInteraction.h:
32         * UIProcess/ios/WKContentViewInteraction.mm:
33         (gestureRecognizerModifierFlags): Added.
34
35         (-[WKContentView _webTouchEventsRecognized:]):
36         (-[WKContentView _highlightLongPressRecognized:]):
37         (-[WKContentView _twoFingerSingleTapGestureRecognized:]):
38         (-[WKContentView _singleTapCommited:]):
39         Pass modifier flags through.
40
41         (-[WKContentView _attemptClickAtLocation:modifierFlags:]): Added.
42         (-[WKContentView actionSheetAssistant:openElementAtLocation:]): This is invoked when a person opens a link
43         via the action sheet. We don't have access to the modifier flags to pass. It also seems like an implementation
44         detail that this action is implemented via mouse click and we should re-evaluate this decision in light of
45         the fact tht the action sheet is browser UI and we tend to be very reserved on what UI actions are visible
46         to the page. On Mac, opening a link via the context menu is not visible to the page, at least from a mouse
47         event perspective.
48         (webEventFlagsForUIKeyModifierFlags): Added.
49         (-[WKContentView _hoverGestureRecognizerChanged:]): Pass modifier flags through.
50         (-[WKContentView _attemptClickAtLocation:]): Deleted.
51         * UIProcess/ios/WebPageProxyIOS.mm:
52         (WebKit::WebPageProxy::handleTwoFingerTapAtPoint):
53         (WebKit::WebPageProxy::commitPotentialTap):
54         (WebKit::WebPageProxy::handleTap):
55         * WebProcess/WebPage/WebPage.h:
56         * WebProcess/WebPage/WebPage.messages.in:
57         * WebProcess/WebPage/ios/WebPageIOS.mm:
58         (WebKit::WebPage::handleSyntheticClick):
59         (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
60         (WebKit::WebPage::completeSyntheticClick):
61         (WebKit::WebPage::handleTap):
62         (WebKit::WebPage::handleTwoFingerTapAtPoint):
63         (WebKit::WebPage::commitPotentialTap):
64         Pass modifier flags through.
65
66 2019-02-11  Youenn Fablet  <youenn@apple.com>
67
68         Filter out Overconstrainederror.constraint when getUserMedia is not granted
69         https://bugs.webkit.org/show_bug.cgi?id=194240
70
71         Reviewed by Eric Carlson.
72
73         Make sure in UIProcess to filter out constraint if either the page was not granted gum access or it has no persistent access.
74
75         Refactor UserMediaPermissionRequestManagerProxy to make the implementation easier to understand.
76
77         Covered by added test.
78
79         * UIProcess/UserMediaPermissionCheckProxy.cpp:
80         (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo):
81         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
82         (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
83         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
84         (WebKit::UserMediaPermissionRequestManagerProxy::grantAccess):
85         (WebKit::UserMediaPermissionRequestManagerProxy::getRequestAction):
86         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
87         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionRequest):
88         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionInvalidRequest):
89         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionValidRequest):
90         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
91         (WebKit::UserMediaPermissionRequestManagerProxy::wasGrantedVideoOrAudioAccess):
92         (WebKit::UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList):
93         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
94         (WebKit::UserMediaPermissionRequestManagerProxy::createPermissionRequest): Deleted.
95         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
96         * UIProcess/UserMediaPermissionRequestProxy.h:
97         (WebKit::UserMediaPermissionRequestProxy::isPending const):
98         (WebKit::UserMediaPermissionRequestProxy::setEligibleVideoDeviceUIDs):
99         (WebKit::UserMediaPermissionRequestProxy::setEligibleAudioDeviceUIDs):
100         (WebKit::UserMediaPermissionRequestProxy::hasAudioDevice const):
101         (WebKit::UserMediaPermissionRequestProxy::hasVideoDevice const):
102         (WebKit::UserMediaPermissionRequestProxy::hasPersistentAccess const):
103         (WebKit::UserMediaPermissionRequestProxy::setHasPersistentAccess):
104         (WebKit::UserMediaPermissionRequestProxy::userMediaID const):
105         (WebKit::UserMediaPermissionRequestProxy::topLevelDocumentSecurityOrigin const):
106         (WebKit::UserMediaPermissionRequestProxy::userMediaDocumentSecurityOrigin const):
107         (WebKit::UserMediaPermissionRequestProxy::userRequest const):
108         (WebKit::UserMediaPermissionRequestProxy::setDeviceIdentifierHashSalt):
109         (WebKit::UserMediaPermissionRequestProxy::deviceIdentifierHashSalt const):
110         (WebKit::UserMediaPermissionRequestProxy::audioDevice const):
111         (WebKit::UserMediaPermissionRequestProxy::videoDevice const):
112         * UIProcess/WebPageProxy.cpp:
113         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
114         * UIProcess/WebPageProxy.h:
115
116 2019-02-11  Carlos Garcia Campos  <cgarcia@igalia.com>
117
118         [WPE] Do not try to create empty egl windows
119         https://bugs.webkit.org/show_bug.cgi?id=194497
120
121         Reviewed by Žan Doberšek.
122
123         In AcceleratedSurfaceWPE we ensure the size we pass to wpe is at least 0x0, but wl_egl_window_create() returns
124         nullptr if 0 is passed as width or height. We should use at least 1x1 instead.
125
126         * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
127         (WebKit::AcceleratedSurfaceWPE::initialize):
128         (WebKit::AcceleratedSurfaceWPE::clientResize):
129
130 2019-02-10  Carlos Garcia Campos  <cgarcia@igalia.com>
131
132         [WPE] Do not use a sync IPC message to send the host FD to the web process
133         https://bugs.webkit.org/show_bug.cgi?id=194216
134
135         Reviewed by Darin Adler.
136
137         It can be sent as a web page creation parameter instead.
138
139         * PlatformWPE.cmake:
140         * Shared/WebPageCreationParameters.cpp:
141         (WebKit::WebPageCreationParameters::encode const):
142         (WebKit::WebPageCreationParameters::decode):
143         * Shared/WebPageCreationParameters.h:
144         * SourcesWPE.txt:
145         * UIProcess/API/wpe/CompositingManagerProxy.cpp: Removed.
146         * UIProcess/API/wpe/CompositingManagerProxy.h: Removed.
147         * UIProcess/API/wpe/CompositingManagerProxy.messages.in: Removed.
148         * UIProcess/API/wpe/PageClientImpl.cpp:
149         (WebKit::PageClientImpl::hostFileDescriptor):
150         * UIProcess/API/wpe/PageClientImpl.h:
151         * UIProcess/API/wpe/WPEView.cpp:
152         (WKWPE::m_backend):
153         * UIProcess/API/wpe/WPEView.h:
154         (WKWPE::View::create):
155         * UIProcess/PageClient.h:
156         * UIProcess/WebPageProxy.cpp:
157         (WebKit::WebPageProxy::creationParameters):
158         * WebProcess/WebPage/WebPage.cpp:
159         (WebKit::m_hostFileDescriptor):
160         * WebProcess/WebPage/WebPage.h:
161         (WebKit::WebPage::releaseHostFileDescriptor):
162         * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
163         (WebKit::AcceleratedSurfaceWPE::AcceleratedSurfaceWPE):
164         (WebKit::AcceleratedSurfaceWPE::initialize):
165         * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.h:
166         * WebProcess/WebPage/wpe/CompositingManager.cpp: Removed.
167         * WebProcess/WebPage/wpe/CompositingManager.h: Removed.
168
169 2019-02-04  Carlos Garcia Campos  <cgarcia@igalia.com>
170
171         [GTK][WPE] Add enable-javascript-markup setting
172         https://bugs.webkit.org/show_bug.cgi?id=193439
173
174         Reviewed by Michael Catanzaro.
175
176         Expose JavaScriptMarkupEnabled setting in the GLib API.
177
178         * UIProcess/API/glib/WebKitSettings.cpp:
179         (webKitSettingsSetProperty):
180         (webKitSettingsGetProperty):
181         (webkit_settings_class_init):
182         (webkit_settings_get_enable_javascript_markup):
183         (webkit_settings_set_enable_javascript_markup):
184         * UIProcess/API/gtk/WebKitSettings.h:
185         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
186         * UIProcess/API/wpe/WebKitSettings.h:
187         * UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
188
189 2019-02-10  Darin Adler  <darin@apple.com>
190
191         Switch uses of StringBuilder with String::format for hex numbers to use HexNumber.h instead
192         https://bugs.webkit.org/show_bug.cgi?id=194485
193
194         Reviewed by Daniel Bates.
195
196         * UIProcess/DeviceIdHashSaltStorage.cpp:
197         (WebKit::DeviceIdHashSaltStorage::completeDeviceIdHashSaltForOriginCall): Use
198         appendUnsignedAsHex instead of appendUnsigned64AsHex.
199
200         * UIProcess/WebBackForwardList.cpp:
201         (WebKit::WebBackForwardList::loggingString): Use appendUnsignedAsHex and
202         reinterpret_cast<uintptr_t> instead of String::format and "%p".
203
204 2019-02-10  Commit Queue  <commit-queue@webkit.org>
205
206         Unreviewed, rolling out r241167.
207         https://bugs.webkit.org/show_bug.cgi?id=194482
208
209         Broke the GTK mediastream tests (Requested by philn on
210         #webkit).
211
212         Reverted changeset:
213
214         "Filter out Overconstrainederror.constraint when getUserMedia
215         is not granted"
216         https://bugs.webkit.org/show_bug.cgi?id=194240
217         https://trac.webkit.org/changeset/241167
218
219 2019-02-09  Darin Adler  <darin@apple.com>
220
221         Eliminate unnecessary String temporaries by using StringConcatenateNumbers
222         https://bugs.webkit.org/show_bug.cgi?id=194021
223
224         Reviewed by Geoffrey Garen.
225
226         * NetworkProcess/NetworkResourceLoader.cpp:
227         (WebKit::escapeIDForJSON): Use an ASCIILiteral to create a String.
228
229         * NetworkProcess/cache/NetworkCacheStorage.cpp:
230         (WebKit::NetworkCache::makeVersionedDirectoryPath): Remove String::number and let
231         makeString do the conversion without allocating/destroying a String.
232
233         * NetworkProcess/mac/RemoteNetworkingContext.mm: Removed "using namespace WebCore".
234         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): Remove String::number
235         and let makeString do the conversion without allocating/destroying a String.
236
237         * NetworkProcess/webrtc/NetworkMDNSRegister.cpp: Removed "using namespace WebCore".
238         (WebKit::registerMDNSNameCallback): Added explicit WebCore prefix as needed.
239         (WebKit::NetworkMDNSRegister::registerMDNSName): Ditto. Also remove String::number
240         and let makeString do the conversion without allocating/destroying a String.
241
242         * UIProcess/WebPageGroup.cpp:
243         (WebKit::pageGroupData): Remove String::number and let makeString do the conversion
244         without allocating/destroying a String.
245         * UIProcess/WebPageProxy.cpp:
246         (WebKit::WebPageProxy::createInspectorTargets): Ditto.
247         * UIProcess/ios/WKLegacyPDFView.mm:
248         (-[WKLegacyPDFView _URLForLinkAnnotation:]): Ditto.
249         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
250         (WebKit::uniqueWorldName): Ditto.
251         * WebProcess/WebPage/WebPageInspectorTarget.cpp:
252         (WebKit::WebPageInspectorTarget::identifier const): Ditto.
253
254 2019-02-09  Alexander Mikhaylenko  <exalm7659@gmail.com>
255
256         [GTK] Fix typo in the newly added API
257         https://bugs.webkit.org/show_bug.cgi?id=194472
258
259         Reviewed by Michael Catanzaro.
260
261         Fix a typo: enableed -> enabled.
262
263         * UIProcess/API/glib/WebKitSettings.cpp:
264         (webkit_settings_set_enable_back_forward_navigation_gestures):
265         * UIProcess/API/gtk/WebKitSettings.h:
266
267 2019-02-08  Alex Christensen  <achristensen@webkit.org>
268
269         Speculative fix for Mojave API test after r241223
270         https://bugs.webkit.org/show_bug.cgi?id=194427
271
272         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
273         (WebKit::XPCInitializationHandler):
274         (WebKit::XPCServiceMain):
275         Set the __APPLEEVENTSSERVICENAME environment variable before handling any xpc messages like we used to.
276         I'll worry about making things right in the daemon later.
277
278 2019-02-08  Chris Dumez  <cdumez@apple.com>
279
280         [WK2][macOS] Avoid creating new CVDisplayLink objects for each WebProcess
281         https://bugs.webkit.org/show_bug.cgi?id=194463
282
283         Reviewed by Tim Horton.
284
285         Avoid creating new CVDisplayLink objects for each WebProcess. We really only need one per
286         display, creating such object is expensive and it is even worse in a PSON world where we
287         swap process on navigation.
288
289         This patch moves the DisplayLink storing from WebProcessProxy to WebProcessPool. Also,
290         a DisplayLink can now be associated to several IPC connections instead of having a 1:1
291         mapping. When a DisplayLink no longer has any observers, we now merely stop it instead
292         of destroying it.
293
294         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
295         (WebKit::WebProcessPool::startDisplayLink):
296         (WebKit::WebProcessPool::stopDisplayLink):
297         (WebKit::WebProcessPool::stopDisplayLinks):
298         * UIProcess/WebProcessPool.h:
299         * UIProcess/WebProcessProxy.cpp:
300         (WebKit::WebProcessProxy::~WebProcessProxy):
301         (WebKit::WebProcessProxy::processWillShutDown):
302         (WebKit::WebProcessProxy::shutDown):
303         * UIProcess/WebProcessProxy.h:
304         * UIProcess/mac/DisplayLink.cpp:
305         (WebKit::DisplayLink::DisplayLink):
306         (WebKit::DisplayLink::addObserver):
307         (WebKit::DisplayLink::removeObserver):
308         (WebKit::DisplayLink::removeObservers):
309         (WebKit::DisplayLink::hasObservers const):
310         (WebKit::DisplayLink::displayLinkCallback):
311         * UIProcess/mac/DisplayLink.h:
312         * UIProcess/mac/WebProcessProxyMac.mm:
313         (WebKit::WebProcessProxy::startDisplayLink):
314         (WebKit::WebProcessProxy::stopDisplayLink):
315
316 2019-02-08  Alexander Mikhaylenko  <exalm7659@gmail.com>
317
318         [GTK] Implement back/forward touchpad gesture
319         https://bugs.webkit.org/show_bug.cgi?id=193919
320
321         Reviewed by Michael Catanzaro.
322
323         Move ViewSnapshotStore and ViewGestureController from Cocoa/Mac directory
324         to UIProcess/, also move some parts of mac/ViewGestreControllerMac.mm to
325         ViewGestureController.cpp, split up Mac- and iOS-specific parts of
326         ViewSnapshotStore.cpp into mac/ViewSnapshotMac.mm, then implement 2-finger
327         touchpad swipe back-forward gesture for GTK based on that.
328
329         To avoid name conflict, rename existing ViewGestureController class inside
330         UIProcess/API/gtk/WebKitWebViewBase.cpp into TouchGestureController.
331
332         Since GTK gestures can only work with 3 or 4 fingers, treat horizontal
333         scrolling events as a swipe as long as there's nowhere to scroll in that
334         direction and web page doesn't handle the scrolling.
335
336         This is only allowed for touchpads, even though it can theoretically work
337         with touch mice and trackpoints.
338
339         The gesture requires every item in back-forward list to have a snapshot.
340         There's already an existing infrastructure for that, so the patch changes
341         a bunch of #if PLATFORM(COCOA) statements to also check for GTK platform.
342         The snapshots have to be taken in sync, so the implementation draws webview
343         widget into a Cairo image surface.
344
345         The gesture is disabled by default, and can be enabled by setting the newly
346         added 'enable-back-forward-navigation-gestures' property in WebKitSettings to
347         true.
348
349         Gesture drawing is implemented via Cairo. When the gesture is active, the
350         actual page is drawn into a Cairo group, which is then drawn together with
351         a given snapshot, as well as dimming and a drop shadow over the "lower" layer.
352
353         Also add a memory pressure handler that clears snapshot store when low on memory.
354
355         * DerivedSources-input.xcfilelist:
356         * PlatformGTK.cmake:
357         * PlatformMac.cmake:
358         * Shared/SessionState.h: Add snapshot to back-forward items for GTK.
359         * Shared/WebBackForwardListItem.h: Add snapshot to back-forward items for GTK.
360         * SourcesCocoa.txt:
361         * SourcesGTK.txt:
362         * UIProcess/API/glib/WebKitSettings.cpp:
363         Added 'enable-back-forward-navigation-gestures' property for enabling the gesture.
364         (webKitSettingsSetProperty):
365         (webKitSettingsGetProperty):
366         (webkit_settings_class_init):
367         (webkit_settings_get_enable_back_forward_navigation_gestures): Added, GTK only.
368         (webkit_settings_set_enable_back_forward_navigation_gestures): Added, GTK only.
369         * UIProcess/API/glib/WebKitWebView.cpp:
370         (enableBackForwardNavigationGesturesChanged): Added, GTK only.
371         (webkitWebViewUpdateSettings):
372         (webkitWebViewDisconnectSettingsSignalHandlers):
373         * UIProcess/API/gtk/PageClientImpl.cpp:
374         (WebKit::PageClientImpl::setViewNeedsDisplay): Redraw the whole screen instead of a region during the gesture.
375         (WebKit::PageClientImpl::takeViewSnapshot): Added.
376         (WebKit::PageClientImpl::wheelEventWasNotHandledByWebCore): Pass unhandled events to the gesture controller.
377         (WebKit::PageClientImpl::didRemoveNavigationGestureSnapshot): Redraw the widget immediately after removing snapshot.
378         (WebKit::PageClientImpl::didStartProvisionalLoadForMainFrame): Added, send a notification to the gesture controller.
379         (WebKit::PageClientImpl::didFirstVisuallyNonEmptyLayoutForMainFrame):  Send a notification to the gesture controller.
380         (WebKit::PageClientImpl::didFinishLoadForMainFrame):  Send a notification to the gesture controller.
381         (WebKit::PageClientImpl::didFailLoadForMainFrame):  Added, send a notification to the gesture controller.
382         (WebKit::PageClientImpl::didSameDocumentNavigationForMainFrame):  Send a notification to the gesture controller.
383         (WebKit::PageClientImpl::didRestoreScrollPosition):  Added, send a notification to the gesture controller.
384         * UIProcess/API/gtk/PageClientImpl.h:
385         * UIProcess/API/gtk/WebKitSettings.h:
386         Add webkit_settings_get_enable_back_forward_navigation_gestures() and webkit_settings_get_enable_back_forward_navigation_gestures()
387         to public API.
388         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
389         (webkitWebViewBaseDraw): Pass drawing to ViewGestureController during the gesture.
390         (webkitWebViewBaseScrollEvent): Pass scroll events to ViewGestureController during the gesture.
391         (webkitWebViewBaseGestureController): Renamed ViewGestureController to TouchGestureController.
392         (webkitWebViewBaseViewGestureController): Added.
393         (webkitWebViewBaseCreateWebPage): Create an instance of ViewGestureController.
394         (webkitWebViewBaseTakeViewSnapshot): Added.
395         (webkitWebViewBaseDidStartProvisionalLoadForMainFrame): Added.
396         (webkitWebViewBaseDidFirstVisuallyNonEmptyLayoutForMainFrame): Added.
397         (webkitWebViewBaseDidFinishLoadForMainFrame): Added.
398         (webkitWebViewBaseDidFailLoadForMainFrame): Added.
399         (webkitWebViewBaseDidSameDocumentNavigationForMainFrame): Added.
400         (webkitWebViewBaseDidRestoreScrollPosition): Added.
401         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
402         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Mentioned the added functions in docs.
403         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
404         (WebKit::WebProcessPool::platformInitialize): Move the check from WebMemoryPressureHandlerCocoa.mm here.
405         * UIProcess/PageClient.h: Add takeViewSnapshot() for GTK.
406         * UIProcess/ViewGestureController.cpp: Renamed from Source/WebKit/UIProcess/Cocoa/ViewGestureController.cpp.
407         (WebKit::ViewGestureController::ViewGestureController):
408         (WebKit::ViewGestureController::~ViewGestureController):
409         (WebKit::ViewGestureController::disconnectFromProcess):
410         (WebKit::ViewGestureController::connectToProcess):
411         (WebKit::ViewGestureController::controllerForGesture):
412         (WebKit::ViewGestureController::takeNextGestureID):
413         (WebKit::ViewGestureController::willBeginGesture):
414         (WebKit::ViewGestureController::didEndGesture):
415         (WebKit::ViewGestureController::setAlternateBackForwardListSourcePage):
416         (WebKit::ViewGestureController::canSwipeInDirection const):
417         (WebKit::ViewGestureController::didStartProvisionalOrSameDocumentLoadForMainFrame):
418         (WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
419         (WebKit::ViewGestureController::didFirstVisuallyNonEmptyLayoutForMainFrame):
420         (WebKit::ViewGestureController::didRepaintAfterNavigation):
421         (WebKit::ViewGestureController::didHitRenderTreeSizeThreshold):
422         (WebKit::ViewGestureController::didRestoreScrollPosition):
423         (WebKit::ViewGestureController::didReachMainFrameLoadTerminalState):
424         (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
425         (WebKit::ViewGestureController::checkForActiveLoads):
426         (WebKit::ViewGestureController::SnapshotRemovalTracker::SnapshotRemovalTracker):
427         (WebKit::ViewGestureController::SnapshotRemovalTracker::eventsDescription):
428         (WebKit::ViewGestureController::SnapshotRemovalTracker::log const):
429         (WebKit::ViewGestureController::SnapshotRemovalTracker::resume):
430         (WebKit::ViewGestureController::SnapshotRemovalTracker::start):
431         (WebKit::ViewGestureController::SnapshotRemovalTracker::reset):
432         (WebKit::ViewGestureController::SnapshotRemovalTracker::stopWaitingForEvent):
433         (WebKit::ViewGestureController::SnapshotRemovalTracker::eventOccurred):
434         (WebKit::ViewGestureController::SnapshotRemovalTracker::cancelOutstandingEvent):
435         (WebKit::ViewGestureController::SnapshotRemovalTracker::hasOutstandingEvent):
436         (WebKit::ViewGestureController::SnapshotRemovalTracker::fireRemovalCallbackIfPossible):
437         (WebKit::ViewGestureController::SnapshotRemovalTracker::fireRemovalCallbackImmediately):
438         (WebKit::ViewGestureController::SnapshotRemovalTracker::watchdogTimerFired):
439         (WebKit::ViewGestureController::SnapshotRemovalTracker::startWatchdog):
440         (WebKit::deltaShouldCancelSwipe):
441         (WebKit::ViewGestureController::PendingSwipeTracker::PendingSwipeTracker):
442         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe):
443         (WebKit::ViewGestureController::PendingSwipeTracker::handleEvent):
444         (WebKit::ViewGestureController::PendingSwipeTracker::eventWasNotHandledByWebCore):
445         (WebKit::ViewGestureController::PendingSwipeTracker::tryToStartSwipe):
446         (WebKit::ViewGestureController::PendingSwipeTracker::reset):
447         (WebKit::ViewGestureController::startSwipeGesture):
448         (WebKit::ViewGestureController::isPhysicallySwipingLeft const):
449         (WebKit::ViewGestureController::shouldUseSnapshotForSize):
450         (WebKit::ViewGestureController::forceRepaintIfNeeded):
451         (WebKit::ViewGestureController::willEndSwipeGesture):
452         (WebKit::ViewGestureController::endSwipeGesture):
453         (WebKit::ViewGestureController::requestRenderTreeSizeNotificationIfNeeded):
454         * UIProcess/ViewGestureController.h: Renamed from Source/WebKit/UIProcess/Cocoa/ViewGestureController.h.
455         (WebKit::ViewGestureController::wheelEventWasNotHandledByWebCore):
456         (WebKit::ViewGestureController::shouldIgnorePinnedState):
457         (WebKit::ViewGestureController::setShouldIgnorePinnedState):
458         (WebKit::ViewGestureController::hasActiveMagnificationGesture const):
459         (WebKit::ViewGestureController::setCustomSwipeViews):
460         (WebKit::ViewGestureController::setCustomSwipeViewsTopContentInset):
461         (WebKit::ViewGestureController::setDidMoveSwipeSnapshotCallback):
462         (WebKit::ViewGestureController::backgroundColorForCurrentSnapshot const):
463         (WebKit::ViewGestureController::didFinishLoadForMainFrame):
464         (WebKit::ViewGestureController::didFailLoadForMainFrame):
465         (WebKit::ViewGestureController::setSwipeGestureEnabled):
466         (WebKit::ViewGestureController::isSwipeGestureEnabled):
467         (WebKit::ViewGestureController::SnapshotRemovalTracker::pause):
468         (WebKit::ViewGestureController::SnapshotRemovalTracker::isPaused const):
469         (WebKit::ViewGestureController::SnapshotRemovalTracker::hasRemovalCallback const):
470         (WebKit::ViewGestureController::SnapshotRemovalTracker::renderTreeSizeThreshold const):
471         (WebKit::ViewGestureController::SnapshotRemovalTracker::setRenderTreeSizeThreshold):
472         (WebKit::ViewGestureController::PendingSwipeTracker::shouldIgnorePinnedState):
473         (WebKit::ViewGestureController::PendingSwipeTracker::setShouldIgnorePinnedState):
474         (WebKit::ViewGestureController::SwipeProgressTracker::progress const):
475         (WebKit::ViewGestureController::SwipeProgressTracker::direction const):
476         * UIProcess/ViewGestureController.messages.in: Renamed from Source/WebKit/UIProcess/Cocoa/ViewGestureController.messages.in.
477         * UIProcess/ViewSnapshotStore.cpp: Copied from Source/WebKit/UIProcess/mac/ViewSnapshotStore.mm.
478         (WebKit::ViewSnapshotStore::ViewSnapshotStore):
479         (WebKit::ViewSnapshotStore::~ViewSnapshotStore):
480         (WebKit::ViewSnapshotStore::singleton):
481         (WebKit::ViewSnapshotStore::didAddImageToSnapshot):
482         (WebKit::ViewSnapshotStore::willRemoveImageFromSnapshot):
483         (WebKit::ViewSnapshotStore::pruneSnapshots):
484         (WebKit::ViewSnapshotStore::recordSnapshot):
485         (WebKit::ViewSnapshotStore::discardSnapshotImages):
486         (WebKit::ViewSnapshot::~ViewSnapshot):
487         * UIProcess/ViewSnapshotStore.h: Renamed from Source/WebKit/UIProcess/mac/ViewSnapshotStore.h.
488         (WebKit::ViewSnapshot::setRenderTreeSize):
489         (WebKit::ViewSnapshot::renderTreeSize const):
490         (WebKit::ViewSnapshot::setBackgroundColor):
491         (WebKit::ViewSnapshot::backgroundColor const):
492         (WebKit::ViewSnapshot::setViewScrollPosition):
493         (WebKit::ViewSnapshot::viewScrollPosition const):
494         (WebKit::ViewSnapshot::setDeviceScaleFactor):
495         (WebKit::ViewSnapshot::deviceScaleFactor const):
496         (WebKit::ViewSnapshot::surface const):
497         (WebKit::ViewSnapshot::imageSizeInBytes const):
498         (WebKit::ViewSnapshot::size const):
499         (WebKit::ViewSnapshotStore::setDisableSnapshotVolatilityForTesting):
500         (WebKit::ViewSnapshotStore::disableSnapshotVolatilityForTesting const):
501         * UIProcess/WebBackForwardList.cpp:
502         (WebKit::WebBackForwardList::didRemoveItem): Unset snapshot for GTK.
503         * UIProcess/WebMemoryPressureHandler.cpp: Copied from Source/WebKit/UIProcess/Cocoa/WebMemoryPressureHandlerCocoa.mm.
504         (WebKit::installMemoryPressureHandler):
505         * UIProcess/WebMemoryPressureHandler.h: Renamed from Source/WebKit/UIProcess/Cocoa/WebMemoryPressureHandlerCocoa.h.
506         * UIProcess/WebPageProxy.cpp:
507         (WebKit::WebPageProxy::recordNavigationSnapshot): Take snapshots for GTK.
508         * UIProcess/WebPageProxy.h:
509         * UIProcess/gtk/ViewGestureControllerGtk.cpp: Added. This is a port of
510         UIProcess/mac/ViewGestureControllerMac.mm. SwipeProgressTracker class is a
511         re-implementation of trackSwipeEventWithOptions.
512         (WebKit::isEventStop):
513         (WebKit::ViewGestureController::platformTeardown):
514         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanStartSwipe):
515         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanEndSwipe):
516         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanInfluenceSwipe):
517         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventGetScrollingDeltas):
518         (WebKit::ViewGestureController::handleScrollWheelEvent):
519         (WebKit::ViewGestureController::trackSwipeGesture):
520         (WebKit::ViewGestureController::SwipeProgressTracker::SwipeProgressTracker):
521         (WebKit::ViewGestureController::SwipeProgressTracker::startTracking):
522         (WebKit::ViewGestureController::SwipeProgressTracker::reset):
523         (WebKit::ViewGestureController::SwipeProgressTracker::handleEvent):
524         (WebKit::ViewGestureController::SwipeProgressTracker::startAnimation):
525         (WebKit::easeOutCubic):
526         (WebKit::ViewGestureController::SwipeProgressTracker::onAnimationTick):
527         (WebKit::ViewGestureController::SwipeProgressTracker::endAnimation):
528         (WebKit::ViewGestureController::beginSwipeGesture):
529         (WebKit::ViewGestureController::handleSwipeGesture):
530         (WebKit::ViewGestureController::draw):
531         (WebKit::ViewGestureController::removeSwipeSnapshot):
532         (WebKit::ViewGestureController::beginSimulatedSwipeInDirectionForTesting):
533         (WebKit::ViewGestureController::completeSimulatedSwipeInDirectionForTesting):
534         * UIProcess/gtk/ViewSnapshotStoreGtk.cpp: Renamed from Source/WebKit/UIProcess/Cocoa/WebMemoryPressureHandlerCocoa.mm.
535         (WebKit::ViewSnapshot::create):
536         (WebKit::ViewSnapshot::ViewSnapshot):
537         (WebKit::ViewSnapshot::hasImage const):
538         (WebKit::ViewSnapshot::clearImage):
539         (WebKit::ViewSnapshot::imageSizeInBytes const):
540         (WebKit::ViewSnapshot::size const):
541         * UIProcess/gtk/WebProcessPoolGtk.cpp:
542         (WebKit::memoryPressureMonitorDisabled): Added.
543         (WebKit::WebProcessPool::platformInitialize): Install memory pressure handler.
544         (WebKit::WebProcessPool::platformInitializeWebProcess): Use memoryPressureMonitorDisabled().
545         * UIProcess/mac/ViewGestureControllerMac.mm:
546         Moved many functions into UIProcess/ViewGestureController.cpp
547         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanStartSwipe):
548         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanEndSwipe):
549         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanInfluenceSwipe):
550         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventGetScrollingDeltas):
551         (WebKit::ViewGestureController::trackSwipeGesture):
552         (WebKit::scrollEventCanInfluenceSwipe): Deleted.
553         (WebKit::deltaShouldCancelSwipe): Deleted.
554         (WebKit::ViewGestureController::PendingSwipeTracker::PendingSwipeTracker): Deleted.
555         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe): Deleted.
556         (WebKit::ViewGestureController::PendingSwipeTracker::handleEvent): Deleted.
557         (WebKit::ViewGestureController::PendingSwipeTracker::eventWasNotHandledByWebCore): Deleted.
558         (WebKit::ViewGestureController::PendingSwipeTracker::tryToStartSwipe): Deleted.
559         (WebKit::ViewGestureController::PendingSwipeTracker::reset): Deleted.
560         (WebKit::ViewGestureController::willEndSwipeGesture): Deleted.
561         (WebKit::ViewGestureController::shouldUseSnapshotForSize): Deleted.
562         (WebKit::ViewGestureController::isPhysicallySwipingLeft const): Deleted.
563         (WebKit::ViewGestureController::endSwipeGesture): Deleted.
564         (WebKit::ViewGestureController::forceRepaintIfNeeded): Deleted.
565         (WebKit::ViewGestureController::requestRenderTreeSizeNotificationIfNeeded): Deleted.
566         * UIProcess/mac/ViewSnapshotStoreMac.mm: Renamed from Source/WebKit/UIProcess/mac/ViewSnapshotStore.mm.
567         (WebKit::ViewSnapshotStore::snapshottingContext):
568         (WebKit::ViewSnapshot::create):
569         (WebKit::ViewSnapshot::ViewSnapshot):
570         (WebKit::ViewSnapshot::setSurface):
571         (WebKit::ViewSnapshot::hasImage const):
572         (WebKit::ViewSnapshot::clearImage):
573         (WebKit::ViewSnapshot::setVolatile):
574         (WebKit::ViewSnapshot::asLayerContents):
575         (WebKit::ViewSnapshot::asImageForTesting):
576         * WebKit.xcodeproj/project.pbxproj:
577         * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
578         Make SetRenderTreeSizeNotificationThreshold() cross-platform.
579         (WebKit::ViewGestureGeometryCollector::ViewGestureGeometryCollector):
580         (WebKit::ViewGestureGeometryCollector::computeMinimumAndMaximumViewportScales const):
581         (WebKit::ViewGestureGeometryCollector::mainFrameDidLayout):
582         * WebProcess/WebPage/ViewGestureGeometryCollector.h:
583         * WebProcess/WebPage/ViewGestureGeometryCollector.messages.in:
584         * WebProcess/WebPage/WebPage.cpp:
585         Start using ViewGestureGeometryCollector for GTK.
586         (WebKit::WebPage::mainFrameDidLayout):
587         * WebProcess/WebPage/WebPage.h:
588
589 2019-02-08  Alex Christensen  <achristensen@webkit.org>
590
591         Add SPI to use networking daemon instead of XPC service
592         https://bugs.webkit.org/show_bug.cgi?id=194427
593
594         Reviewed by Geoffrey Garen.
595
596         There is still work to be done, but with the proper plist it starts and loads webpages!
597
598         * NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm:
599         (WebKit::DaemonMain):
600         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
601         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
602         (WebKit::XPCEventHandler):
603         (WebKit::XPCInitializationHandler):
604         (WebKit::XPCServiceMain):
605         (WebKit::XPCServiceEventHandler): Deleted.
606         * UIProcess/API/APIProcessPoolConfiguration.h:
607         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
608         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
609         (-[_WKProcessPoolConfiguration usesNetworkingDaemon]):
610         (-[_WKProcessPoolConfiguration setUsesNetworkingDaemon:]):
611         * UIProcess/AuxiliaryProcessProxy.cpp:
612         (WebKit::AuxiliaryProcessProxy::getLaunchOptions):
613         * UIProcess/Launcher/ProcessLauncher.h:
614         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
615         (WebKit::serviceName):
616         (WebKit::ProcessLauncher::launchProcess):
617         * UIProcess/Network/NetworkProcessProxy.cpp:
618         (WebKit::NetworkProcessProxy::getLaunchOptions):
619         * UIProcess/WebProcessPool.cpp:
620         (WebKit::WebProcessPool::usesNetworkingDaemon const):
621         * UIProcess/WebProcessPool.h:
622
623 2019-02-08  Truitt Savell  <tsavell@apple.com>
624
625         Unreviewed, rolling out r241197.
626
627         Broke iOS Simulator Debug build and casued 1 API failure on
628         High Sierra
629
630         Reverted changeset:
631
632         "Add SPI to use networking daemon instead of XPC service"
633         https://bugs.webkit.org/show_bug.cgi?id=194427
634         https://trac.webkit.org/changeset/241197
635
636 2019-02-08  Beth Dakin  <bdakin@apple.com>
637
638         Abstract and discussion comments needed for afterScreenUpdates
639         https://bugs.webkit.org/show_bug.cgi?id=194442
640
641         Reviewed by Wenson Hsieh.
642
643         Forgot to add these comments with https://bugs.webkit.org/show_bug.cgi?id=194362
644         * UIProcess/API/Cocoa/WKSnapshotConfiguration.h:
645
646 2019-02-08  Beth Dakin  <bdakin@apple.com>
647
648         Add afterScreenUpdates to WKSnapshotConfiguration
649         https://bugs.webkit.org/show_bug.cgi?id=194362
650         -and corresponding-
651         <rdar://problem/40655528> Please add an "after screen updates" property to 
652         WKSnapshotConfiguration (to solve blank snapshots)
653
654         Reviewed by Tim Horton.
655
656         This is the WebKit equivalent of - (UIView *)snapshotViewAfterScreenUpdates:(BOOL)afterUpdates;
657         This makes our snapshotting API more predictable and reliable on iOS devices, 
658         which is why the new configuration property defaults to YES.
659
660         New property that defaults to YES.
661         * UIProcess/API/Cocoa/WKSnapshotConfiguration.h:
662         * UIProcess/API/Cocoa/WKSnapshotConfiguration.mm:
663         (-[WKSnapshotConfiguration init]):
664         (-[WKSnapshotConfiguration copyWithZone:]):
665
666         When afterScreenUpdates is set, invoke the snapshot via 
667         callAfterNextPresentationUpdate.
668         * UIProcess/API/Cocoa/WKWebView.mm:
669         (-[WKWebView takeSnapshotWithConfiguration:completionHandler:]):
670         (-[WKWebView _callCompletionHandler:withSnapshotImage:atDeviceScale:]):
671
672 2019-02-08  Alex Christensen  <achristensen@webkit.org>
673
674         Add SPI to use networking daemon instead of XPC service
675         https://bugs.webkit.org/show_bug.cgi?id=194427
676
677         Reviewed by Geoffrey Garen.
678
679         There is still work to be done, but with the proper plist it starts and loads webpages!
680
681         * NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm:
682         (WebKit::DaemonMain):
683         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
684         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
685         (WebKit::XPCEventHandler):
686         (WebKit::XPCInitializationHandler):
687         (WebKit::XPCServiceMain):
688         (WebKit::XPCServiceEventHandler): Deleted.
689         * UIProcess/API/APIProcessPoolConfiguration.h:
690         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
691         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
692         (-[_WKProcessPoolConfiguration usesNetworkingDaemon]):
693         (-[_WKProcessPoolConfiguration setUsesNetworkingDaemon:]):
694         * UIProcess/AuxiliaryProcessProxy.cpp:
695         (WebKit::AuxiliaryProcessProxy::getLaunchOptions):
696         * UIProcess/Launcher/ProcessLauncher.h:
697         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
698         (WebKit::serviceName):
699         (WebKit::ProcessLauncher::launchProcess):
700         * UIProcess/Network/NetworkProcessProxy.cpp:
701         (WebKit::NetworkProcessProxy::getLaunchOptions):
702         * UIProcess/WebProcessPool.cpp:
703         (WebKit::WebProcessPool::usesNetworkingDaemon const):
704         * UIProcess/WebProcessPool.h:
705
706 2019-02-08  Keith Rollin  <krollin@apple.com>
707
708         Unreviewed build fix.
709
710         r241135 modified how entitlements were built up for the macOS. Those
711         changes broke the iOSMac builds. Bring back some deletions in order to
712         fix iOSMac.
713
714         * Configurations/PluginService.64.xcconfig:
715         * Configurations/PluginService.entitlements: Added.
716         * WebKit.xcodeproj/project.pbxproj:
717
718 2019-02-07  Chris Dumez  <cdumez@apple.com>
719
720         Mark more heap-allocated classes as fast allocated
721         https://bugs.webkit.org/show_bug.cgi?id=194422
722
723         Reviewed by Ryosuke Niwa.
724
725         * NetworkProcess/NetworkLoad.cpp:
726         * NetworkProcess/NetworkLoadChecker.h:
727         * NetworkProcess/NetworkResourceLoader.cpp:
728         * Platform/IPC/Connection.h:
729         * Platform/IPC/mac/ImportanceAssertion.h:
730         * PluginProcess/PluginCreationParameters.h:
731         * Shared/API/Cocoa/RemoteObjectRegistry.h:
732         * Shared/WebEvent.h:
733         * UIProcess/API/APIHTTPCookieStore.cpp:
734         * UIProcess/API/APINotificationProvider.h:
735         * UIProcess/API/Cocoa/PageLoadStateObserver.h:
736         * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
737         * UIProcess/API/Cocoa/WKWebView.mm:
738         (-[WKWebView _setInputDelegate:]):
739         * UIProcess/API/gtk/PageClientImpl.h:
740         * UIProcess/BackingStore.h:
741         * UIProcess/Cocoa/AutomationClient.h:
742         * UIProcess/Cocoa/DiagnosticLoggingClient.h:
743         * UIProcess/Cocoa/DownloadClient.h:
744         * UIProcess/Cocoa/FindClient.h:
745         * UIProcess/Cocoa/NavigationState.h:
746         * UIProcess/Cocoa/UIDelegate.h:
747         * UIProcess/Cocoa/ViewGestureController.h:
748         * UIProcess/DeviceIdHashSaltStorage.h:
749         * UIProcess/Downloads/DownloadProxyMap.h:
750         * UIProcess/Gamepad/UIGamepad.h:
751         * UIProcess/Notifications/WebNotificationProvider.h:
752         * UIProcess/ProcessAssertion.h:
753         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h:
754         * UIProcess/WebContextInjectedBundleClient.h:
755         * UIProcess/WebFormClient.h:
756         * UIProcess/WebGeolocationProvider.h:
757         * UIProcess/WebPageProxy.h:
758         * WebProcess/Automation/WebAutomationSessionProxy.h:
759         * WebProcess/InjectedBundle/API/APIInjectedBundleBundleClient.h:
760         * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h:
761         * WebProcess/InjectedBundle/API/APIInjectedBundlePageContextMenuClient.h:
762         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
763         * WebProcess/InjectedBundle/API/APIInjectedBundlePageResourceLoadClient.h:
764         * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
765         * WebProcess/InjectedBundle/APIInjectedBundleFormClient.h:
766         * WebProcess/Network/webrtc/LibWebRTCNetwork.h:
767         * WebProcess/Network/webrtc/LibWebRTCSocket.h:
768         * WebProcess/Network/webrtc/WebRTCResolver.h:
769         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
770         * WebProcess/WebPage/DrawingArea.h:
771
772 2019-02-07  Wenson Hsieh  <wenson_hsieh@apple.com>
773
774         [iOS] [WK2] Modernize code for applying autocorrection
775         https://bugs.webkit.org/show_bug.cgi?id=194397
776
777         Reviewed by Tim Horton.
778
779         * UIProcess/ios/WKContentViewInteraction.h:
780         * UIProcess/ios/WKContentViewInteraction.mm:
781         (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
782         (-[WKContentView applyAutocorrection:toString:withCompletionHandler:]):
783
784         Use BlockPtr instead of temporarily storing the completion handler.
785
786         * WebProcess/WebPage/WebPage.h:
787         * WebProcess/WebPage/WebPage.messages.in:
788
789         Change a LegacySync to Delayed.
790
791         * WebProcess/WebPage/ios/WebPageIOS.mm:
792         (WebKit::WebPage::applyAutocorrection):
793         (WebKit::WebPage::syncApplyAutocorrection):
794         (WebKit::WebPage::applyAutocorrectionInternal):
795
796 2019-02-07  Wenson Hsieh  <wenson_hsieh@apple.com>
797
798         [iOS] Clicking links in Safari using Apple Pencil is much more difficult after r238475
799         https://bugs.webkit.org/show_bug.cgi?id=194415
800         <rdar://problem/47550281>
801
802         Reviewed by Tim Horton.
803
804         Fix the bug by not firing the Apple-pencil-exclusive tap gesture recognizer in the case where editable images
805         are disabled. This gesture recognizer is only used for inserting editable images, and currently conflicts with
806         the synthetic click gesture recognizer used to recognize clicks from generic digitizer inputs.
807
808         * UIProcess/ios/WKContentViewInteraction.mm:
809         (-[WKContentView gestureRecognizerShouldBegin:]):
810         (-[WKContentView _stylusSingleTapRecognized:]):
811
812 2019-02-07  Per Arne Vollan  <pvollan@apple.com>
813
814         [macOS] Block coreservicesd in sandbox.
815         https://bugs.webkit.org/show_bug.cgi?id=192670
816
817         Reviewed by Alexey Proskuryakov.
818
819         We should block CoreServices in newer versions of macOS. In order to achieve this we need to avoid calling
820         _RegisterApplication before entering the sandbox, since this call will open up a connection to CoreServices.
821         The call to _RegisterApplication is moved to ChildProcess::updateProcessName, since it is needed to
822         successfully update the process name. The call to ChildProcess::updateProcessName is made after entering
823         the sandbox.
824
825         * Shared/AuxiliaryProcess.cpp:
826         (WebKit::AuxiliaryProcess::initialize):
827         * WebProcess/cocoa/WebProcessCocoa.mm:
828         (WebKit::WebProcess::initializeProcessName):
829         (WebKit::WebProcess::platformInitializeProcess):
830         * WebProcess/com.apple.WebProcess.sb.in:
831
832 2019-02-07  Youenn Fablet  <youenn@apple.com>
833
834         Filter out Overconstrainederror.constraint when getUserMedia is not granted
835         https://bugs.webkit.org/show_bug.cgi?id=194240
836
837         Reviewed by Eric Carlson.
838
839         Make sure in UIProcess to filter out constraint if either the page was not granted gum access or it has no persistent access.
840
841         Refactor UserMediaPermissionRequestManagerProxy to make the implementation easier to understand.
842
843         Covered by added test.
844
845         * UIProcess/UserMediaPermissionCheckProxy.cpp:
846         (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo):
847         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
848         (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
849         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
850         (WebKit::UserMediaPermissionRequestManagerProxy::grantAccess):
851         (WebKit::UserMediaPermissionRequestManagerProxy::getRequestAction):
852         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
853         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionRequest):
854         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionInvalidRequest):
855         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionValidRequest):
856         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
857         (WebKit::UserMediaPermissionRequestManagerProxy::wasGrantedVideoOrAudioAccess):
858         (WebKit::UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList):
859         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
860         (WebKit::UserMediaPermissionRequestManagerProxy::createPermissionRequest): Deleted.
861         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
862         * UIProcess/UserMediaPermissionRequestProxy.h:
863         (WebKit::UserMediaPermissionRequestProxy::isPending const):
864         (WebKit::UserMediaPermissionRequestProxy::setEligibleVideoDeviceUIDs):
865         (WebKit::UserMediaPermissionRequestProxy::setEligibleAudioDeviceUIDs):
866         (WebKit::UserMediaPermissionRequestProxy::hasAudioDevice const):
867         (WebKit::UserMediaPermissionRequestProxy::hasVideoDevice const):
868         (WebKit::UserMediaPermissionRequestProxy::hasPersistentAccess const):
869         (WebKit::UserMediaPermissionRequestProxy::setHasPersistentAccess):
870         (WebKit::UserMediaPermissionRequestProxy::userMediaID const):
871         (WebKit::UserMediaPermissionRequestProxy::topLevelDocumentSecurityOrigin const):
872         (WebKit::UserMediaPermissionRequestProxy::userMediaDocumentSecurityOrigin const):
873         (WebKit::UserMediaPermissionRequestProxy::userRequest const):
874         (WebKit::UserMediaPermissionRequestProxy::setDeviceIdentifierHashSalt):
875         (WebKit::UserMediaPermissionRequestProxy::deviceIdentifierHashSalt const):
876         (WebKit::UserMediaPermissionRequestProxy::audioDevice const):
877         (WebKit::UserMediaPermissionRequestProxy::videoDevice const):
878         * UIProcess/WebPageProxy.cpp:
879         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
880         * UIProcess/WebPageProxy.h:
881
882 2019-02-07  Wenson Hsieh  <wenson_hsieh@apple.com>
883
884         [iOS] [WK2] Modernize autocorrection context code
885         https://bugs.webkit.org/show_bug.cgi?id=194373
886
887         Reviewed by Tim Horton.
888
889         * Shared/ios/WebAutocorrectionContext.h: Added.
890         (WebKit::WebAutocorrectionContext::encode const):
891         (WebKit::WebAutocorrectionContext::decode):
892
893         Introduce a WebAutocorrectionContext struct that encapsulates the individual pieces of autocorrection context.
894         Change to use this instead of a long list of arguments when propagating autocorrection context information over
895         IPC.
896
897         * UIProcess/AutoCorrectionCallback.h:
898         * UIProcess/WebPageProxy.h:
899         * UIProcess/WebPageProxy.messages.in:
900         * UIProcess/ios/WKContentViewInteraction.h:
901         * UIProcess/ios/WKContentViewInteraction.mm:
902         (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
903         (+[WKAutocorrectionContext autocorrectionContextWithContext:]):
904         (+[WKAutocorrectionContext autocorrectionContextWithData:markedText:selectedText:afterText:selectedRangeInMarkedText:]): Deleted.
905
906         Change this constructor to take an entire WebAutocorrectionContext.
907
908         * UIProcess/ios/WebPageProxyIOS.mm:
909         (WebKit::WebPageProxy::autocorrectionContextCallback):
910         (WebKit::WebPageProxy::requestAutocorrectionContext):
911         (WebKit::WebPageProxy::autocorrectionContextSync):
912         (WebKit::WebPageProxy::getAutocorrectionContext): Deleted.
913         * WebKit.xcodeproj/project.pbxproj:
914         * WebProcess/WebPage/WebPage.h:
915         * WebProcess/WebPage/WebPage.messages.in:
916
917         Use Delayed instead of LegacySync.
918
919         * WebProcess/WebPage/ios/WebPageIOS.mm:
920         (WebKit::WebPage::autocorrectionContext):
921
922         Renamed from computeAutocorrectionContext. This is now a private method on WebPage that uses the focused or main
923         frame to compute and return a WebAutocorrectionContext.
924
925         (WebKit::WebPage::requestAutocorrectionContext):
926         (WebKit::WebPage::autocorrectionContextSync):
927
928         Renamed getAutocorrectionContext to autocorrectionContextSync.
929
930         (WebKit::computeAutocorrectionContext): Deleted.
931         (WebKit::WebPage::getAutocorrectionContext): Deleted.
932
933 2019-02-07  Youenn Fablet  <youenn@apple.com>
934
935         Simplify applyConstraints callbacks
936         https://bugs.webkit.org/show_bug.cgi?id=194297
937
938         Reviewed by Eric Carlson.
939
940         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
941         (WebKit::UserMediaCaptureManagerProxy::applyConstraints):
942         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
943         (WebKit::UserMediaCaptureManager::Source::applyConstraintsSucceeded):
944         (WebKit::UserMediaCaptureManager::Source::applyConstraintsFailed):
945         (WebKit::UserMediaCaptureManager::applyConstraintsFailed):
946         * WebProcess/cocoa/UserMediaCaptureManager.h:
947
948 2019-02-07  Brent Fulgham  <bfulgham@apple.com>
949
950         Permit additional IOKit Properties needed by Media PlugIns on older Mac Hardware
951         https://bugs.webkit.org/show_bug.cgi?id=194412
952         <rdar://problem/47820615>
953
954         Reviewed by Per Arne Vollan.
955
956         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
957
958 2019-02-07  Brent Fulgham  <bfulgham@apple.com>
959
960         Permit additional IOKit Properties needed by older Mac Hardware
961         https://bugs.webkit.org/show_bug.cgi?id=194410
962         <rdar://problem/47820620>
963
964         Reviewed by Per Arne Vollan.
965
966         * WebProcess/com.apple.WebProcess.sb.in:
967
968 2019-02-07  Brady Eidson  <beidson@apple.com>
969
970         Rename the TAKE_DOWNLOAD_ASSERTION macro.
971
972         Rubberstamped by Andy Estes.
973
974         * NetworkProcess/Downloads/DownloadMap.cpp:
975         * NetworkProcess/Downloads/DownloadMap.h:
976
977 2019-02-07  Keith Rollin  <krollin@apple.com>
978
979         Fix XCBuild issue related to codesigning WebContent process
980         https://bugs.webkit.org/show_bug.cgi?id=193799
981         <rdar://problem/47533890>
982
983         Reviewed by Brent Fulgham.
984
985         Building with XCBuild enabled results in the error message "cannot
986         read entitlement data" when trying to codesign the macOS XPC
987         processes. The reason for this error message is that there is a build
988         step that deletes any previous "stale" generated .xcent file before
989         building up a new one. With XCBuild enabled, the build steps got
990         re-ordered, such that the step that deletes this file could get
991         executed after the steps that build up the file. The built-up set of
992         entitlements is now gone, and the build process fails when `codesign`
993         tries to access it.
994
995         The apparent quick-fix to this problem -- of tweaking dependencies so
996         that the build steps execute in the desired order -- wouldn't work
997         with XCBuild. Establishing these dependencies would require both
998         having multiple build phases produce the same .xcent file as output,
999         as well as a build phase that has this file as an input and an output.
1000         XCBuild either forbids or frowns upon these configurations.
1001
1002         Ultimately, the solution that worked was to take over complete control
1003         of the codesigning process. This means (a) not specifying a base
1004         .entitlements file that XCode uses to start with (and which was
1005         subsequently altered via custom build scripts), (b) not letting XCode
1006         automatically and silently inject a 'get-task-all' entitlement used to
1007         facilitate debugging (we now add that entitlement by hand), and (c)
1008         building up all of our entitlements by hand via a single custom
1009         script. Because of the addition of this custom script, many other
1010         scripts and entitlements files could now be removed.
1011
1012         * Configurations/BaseXPCService.xcconfig:
1013         * Configurations/Databases-iOS.entitlements: Removed.
1014         * Configurations/Network-OSX-restricted.entitlements: Removed.
1015         * Configurations/Network-OSX-sandbox.entitlements: Removed.
1016         * Configurations/Network-OSX.entitlements: Removed.
1017         * Configurations/NetworkService.xcconfig:
1018         * Configurations/PluginService.64.xcconfig:
1019         * Configurations/PluginService.entitlements: Removed.
1020         * Configurations/WebContent-OSX-sandbox.entitlements: Removed.
1021         * Configurations/WebContent-OSX.entitlements: Removed.
1022         * Configurations/WebContent-or-Plugin-OSX-restricted.entitlements: Removed.
1023         * Configurations/WebContentService.xcconfig:
1024         * Scripts/copy-webcontent-resources-to-private-headers.sh:
1025         * Scripts/process-entitlements.sh: Added.
1026         * Scripts/process-network-sandbox-entitlements.sh: Removed.
1027         * Scripts/process-webcontent-or-plugin-entitlements.sh: Removed.
1028         * Scripts/process-webcontent-sandbox-entitlements.sh: Removed.
1029         * WebKit.xcodeproj/project.pbxproj:
1030
1031 2019-02-07  Alex Christensen  <achristensen@webkit.org>
1032
1033         Fix internal build after r241127
1034         https://bugs.webkit.org/show_bug.cgi?id=191394
1035
1036         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
1037         Add some (un)availability macros.
1038
1039 2019-02-07  Youenn Fablet  <youenn@apple.com>
1040
1041         Make to clear sources from UserMediaCaptureManagerProxy and UserMediaCaptureManager when no longer needed
1042         https://bugs.webkit.org/show_bug.cgi?id=194312
1043
1044         Reviewed by Eric Carlson.
1045
1046         Sources in UserMediaCaptureManager and Proxy are never removed once added to their HashMap.
1047         Use the 'ended' mechanism to do the clean-up on WebProcess side.
1048         As part of this clean-up, send IPC to UIProcess to do clean-up on proxy side.
1049         On WebProcess crash case, clean-up the proxy as well.
1050
1051         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
1052         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
1053         (WebKit::UserMediaCaptureManagerProxy::end):
1054         (WebKit::UserMediaCaptureManagerProxy::clear):
1055         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
1056         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
1057         * UIProcess/WebProcessProxy.cpp:
1058         (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
1059         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
1060         (WebKit::UserMediaCaptureManager::sourceEnded):
1061         * WebProcess/cocoa/UserMediaCaptureManager.h:
1062
1063 2019-02-07  Alex Christensen  <achristensen@webkit.org>
1064
1065         Print backgrounds preference should be honored instead of WKWebViewConfiguration value
1066         https://bugs.webkit.org/show_bug.cgi?id=194364
1067         <rdar://problem/47627599>
1068
1069         Reviewed by Tim Horton.
1070
1071         Without this patch, changing the preference for printing the background has no effect.
1072         This patch fixes that, and I verified it manually by checking "Print backgrounds" in Safari's print menu.
1073         Unfortunately, the only way to test this is actually printing because only values from WebPageProxy::preferences
1074         or WebPageProxy::configuration's preferences are exposed to the API, but values from WebPageProxy::preferencesStore
1075         are used when printing.  Actually printing verifies this change fixes the bug.
1076
1077         * UIProcess/API/Cocoa/WKWebView.mm:
1078         (-[WKWebView _initializeWithConfiguration:]):
1079
1080 2019-02-07  Chris Dumez  <cdumez@apple.com>
1081
1082         Mark DisplayLink as fast allocated
1083         https://bugs.webkit.org/show_bug.cgi?id=194400
1084
1085         Reviewed by Geoffrey Garen.
1086
1087         * UIProcess/mac/DisplayLink.h:
1088
1089 2019-02-07  Per Arne Vollan  <pvollan@apple.com>
1090
1091         [macOS] API test times out after r241026
1092         https://bugs.webkit.org/show_bug.cgi?id=194372
1093
1094         Reviewed by Alex Christensen.
1095
1096         The API test TestWebKitAPI.RenderingProgress.FirstMeaningfulPaint times out after r241026.
1097         A new function pointer, layoutMilestones, is added to WKBundlePageLoaderClient, in order
1098         for clients to decide which milestones they would like to listen for.
1099
1100         * WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h:
1101         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1102         (layoutMilestones):
1103         (setUpPageLoaderClient):
1104         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
1105         (WebKit::InjectedBundlePageLoaderClient::layoutMilestones const):
1106         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
1107
1108 2019-02-07  Alex Christensen  <achristensen@webkit.org>
1109
1110         Deprecate WKBundlePageSetDefersLoading
1111         https://bugs.webkit.org/show_bug.cgi?id=191394
1112
1113         Reviewed by Dean Jackson.
1114
1115         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1116         (WKBundlePageSetDefersLoading):
1117         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
1118         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1119         (-[WKWebProcessPlugInBrowserContextController _defersLoading]):
1120         (-[WKWebProcessPlugInBrowserContextController _setDefersLoading:]):
1121         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
1122
1123 2019-02-07  Alex Christensen  <achristensen@webkit.org>
1124
1125         Digital crown should scroll safe browsing warning on watchOS
1126         https://bugs.webkit.org/show_bug.cgi?id=194363
1127         <rdar://problem/47348124>
1128
1129         Reviewed by Wenson Hsieh.
1130
1131         * UIProcess/Cocoa/WKSafeBrowsingWarning.h:
1132         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
1133         (-[WKSafeBrowsingWarning initWithFrame:safeBrowsingWarning:completionHandler:]):
1134         (-[WKSafeBrowsingWarning addContent]):
1135
1136 2019-02-07  Alex Christensen  <achristensen@webkit.org>
1137
1138         Shrink and hyphenate safe browsing warning text on watchOS
1139         https://bugs.webkit.org/show_bug.cgi?id=194361
1140         <rdar://problem/47466549>
1141
1142         Reviewed by Geoffrey Garen.
1143
1144         Some internationalizations use long words that didn't fit on small watches.
1145
1146         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
1147         (fontOfSize):
1148         (-[WKSafeBrowsingWarning addContent]):
1149         (-[WKSafeBrowsingTextView initWithAttributedString:forWarning:]):
1150
1151 2019-02-07  Miguel Gomez  <magomez@igalia.com>
1152
1153         [WPE] Implement GStreamer based holepunch
1154         https://bugs.webkit.org/show_bug.cgi?id=193715
1155
1156         Reviewed by Xabier Rodriguez-Calvar.
1157
1158         Add a new parameter to the calls of TextureMapper::drawSolidColor().
1159
1160         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1161         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
1162
1163 2019-02-06  Benjamin Poulain  <benjamin@webkit.org>
1164
1165         Unreviewed, rolling out r240759 and r240944.
1166
1167         Some timer uses are done off the main thread, WebCore::Timer
1168         cannot be used
1169
1170         Reverted changesets:
1171
1172         "<rdar://problem/47570443> Responsiveness timers are too
1173         expensive for frequent events"
1174         https://bugs.webkit.org/show_bug.cgi?id=194003
1175         https://trac.webkit.org/changeset/240759
1176
1177         "Use deferrable timer to restart the Responsiveness Timer on
1178         each wheel event"
1179         https://bugs.webkit.org/show_bug.cgi?id=194135
1180         https://trac.webkit.org/changeset/240944
1181
1182 2019-02-06  chris fleizach  <cfleizach@apple.com>
1183
1184         AX:  com.apple.WebKit.WebContent at WebKit: -[WKAccessibilityWebPageObjectBase axObjectCache]
1185         https://bugs.webkit.org/show_bug.cgi?id=194306
1186         <rdar://problem/47764549>
1187
1188         Reviewed by Zalan Bujtas.
1189
1190         Check the page reference is still valid.
1191         Modernize code in this area.
1192
1193         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
1194
1195 2019-02-06  Daniel Bates  <dabates@apple.com>
1196
1197         Move toNSEventModifierFlags() and toNSButtonNumber() to WebEventFactory.mm
1198         https://bugs.webkit.org/show_bug.cgi?id=194321
1199
1200         Reviewed by Jer Noble.
1201
1202         Move some code to WebEventFactory so that it can be shared by both WKNavigationAction.mm
1203         and UIDelegate.mm among other benefits.
1204
1205         * Shared/mac/WebEventFactory.h:
1206         * Shared/mac/WebEventFactory.mm:
1207         (WebKit::WebEventFactory::toNSEventModifierFlags):
1208         (WebKit::WebEventFactory::toNSButtonNumber):
1209         * UIProcess/API/Cocoa/WKNavigationAction.mm:
1210         (-[WKNavigationAction modifierFlags]):
1211         (-[WKNavigationAction buttonNumber]):
1212         (toNSEventModifierFlags): Deleted.
1213         (toNSButtonNumber): Deleted.
1214         * UIProcess/Cocoa/UIDelegate.mm:
1215         (WebKit::UIDelegate::UIClient::mouseDidMoveOverElement):
1216         (WebKit::toNSEventModifierFlags): Deleted.
1217
1218 2019-02-06  Andy Estes  <aestes@apple.com>
1219
1220         [Payment Request] It should be possible to require a phonetic name for shipping contacts
1221         https://bugs.webkit.org/show_bug.cgi?id=194311
1222         <rdar://46733045>
1223
1224         Reviewed by Alex Christensen.
1225
1226         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
1227         (WebKit::WebPaymentCoordinator::supportsVersion): Deleted.
1228         * WebProcess/ApplePay/WebPaymentCoordinator.h:
1229
1230 2019-02-06  Keith Rollin  <krollin@apple.com>
1231
1232         Really enable the automatic checking and regenerations of .xcfilelists during builds
1233         https://bugs.webkit.org/show_bug.cgi?id=194357
1234         <rdar://problem/47861231>
1235
1236         Reviewed by Chris Dumez.
1237
1238         Bug 194124 was supposed to enable the automatic checking and
1239         regenerating of .xcfilelist files during the build. While related
1240         changes were included in that patch, the change to actually enable the
1241         operation somehow was omitted. This patch actually enables the
1242         operation. The check-xcfilelist.sh scripts now check
1243         WK_DISABLE_CHECK_XCFILELISTS, and if it's "1", opts-out the developer
1244         from the checking.
1245
1246         * Scripts/check-xcfilelists.sh:
1247
1248 2019-02-06  John Wilander  <wilander@apple.com>
1249
1250         Forward Ad Click Attribution data from HTMLAnchorElement::handleClick() to WebKit::NavigationActionData
1251         https://bugs.webkit.org/show_bug.cgi?id=194325
1252         <rdar://problem/47840283>
1253
1254         Reviewed by Chris Dumez.
1255
1256         * Shared/NavigationActionData.cpp:
1257         (WebKit::NavigationActionData::encode const):
1258         (WebKit::NavigationActionData::decode):
1259         * Shared/NavigationActionData.h:
1260             Now holds an optional WebCore::AdClickAttribution object.
1261
1262 2019-02-06  Daniel Bates  <dabates@apple.com>
1263
1264         Fix the Apple Internal build. See <rdar://problem/47860943> for more details.
1265
1266         * UIProcess/ios/fullscreen/WKFullscreenStackView.mm:
1267         (-[WKFullscreenStackView init]):
1268
1269 2019-02-06  Daniel Bates  <dabates@apple.com>
1270
1271         Standardize on ControlKey instead of CtrlKey
1272         https://bugs.webkit.org/show_bug.cgi?id=194317
1273
1274         Reviewed by Tim Horton.
1275
1276         * Shared/WebEventConversion.cpp:
1277         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
1278         (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):
1279         (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
1280         (WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent):
1281         (WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent):
1282         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
1283         (WebKit::WebEditorClient::handleKeyboardEvent):
1284         * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
1285         (WebKit::handleKeyPress):
1286
1287 2019-02-06  Per Arne Vollan  <pvollan@apple.com>
1288
1289         Roll out parts of r238819 since it is a PLT performance regression.
1290         https://bugs.webkit.org/show_bug.cgi?id=194346
1291
1292         Unreviewed performance fix.
1293
1294         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1295         (didStartProvisionalLoadForFrame):
1296         (didReceiveServerRedirectForProvisionalLoadForFrame):
1297         (didFinishLoadForFrame):
1298         (globalObjectIsAvailableForFrame):
1299         (didRemoveFrameFromHierarchy):
1300         (didCommitLoadForFrame):
1301         (didFinishDocumentLoadForFrame):
1302         (didFailProvisionalLoadWithErrorForFrame):
1303         (didFailLoadWithErrorForFrame):
1304         (didSameDocumentNavigationForFrame):
1305         (didLayoutForFrame):
1306         (didReachLayoutMilestone):
1307         (didFirstVisuallyNonEmptyLayoutForFrame):
1308         (didHandleOnloadEventsForFrame):
1309         (userAgentForURL):
1310         (setUpPageLoaderClient):
1311         (willSendRequestForFrame):
1312         (didInitiateLoadForResource):
1313         (didFinishLoadForResource):
1314         (didFailLoadForResource):
1315         (setUpResourceLoadClient):
1316         (-[WKWebProcessPlugInBrowserContextController setLoadDelegate:]):
1317         (ResourceLoadClient::ResourceLoadClient): Deleted.
1318         (ResourceLoadClient::loadDelegate const): Deleted.
1319         (ResourceLoadClient::pluginContextController const): Deleted.
1320         (PageLoaderClient::PageLoaderClient): Deleted.
1321         (PageLoaderClient::loadDelegate const): Deleted.
1322         (PageLoaderClient::pluginContextController const): Deleted.
1323         (PageLoaderClient::didStartProvisionalLoadForFrame): Deleted.
1324         (PageLoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame): Deleted.
1325         (PageLoaderClient::didFinishLoadForFrame): Deleted.
1326         (PageLoaderClient::globalObjectIsAvailableForFrame): Deleted.
1327         (PageLoaderClient::didRemoveFrameFromHierarchy): Deleted.
1328         (PageLoaderClient::didCommitLoadForFrame): Deleted.
1329         (PageLoaderClient::didFinishDocumentLoadForFrame): Deleted.
1330         (PageLoaderClient::didFailProvisionalLoadWithErrorForFrame): Deleted.
1331         (PageLoaderClient::didFailLoadWithErrorForFrame): Deleted.
1332         (PageLoaderClient::didSameDocumentNavigationForFrame): Deleted.
1333         (PageLoaderClient::didLayoutForFrame): Deleted.
1334         (PageLoaderClient::didReachLayoutMilestone): Deleted.
1335         (PageLoaderClient::didFirstVisuallyNonEmptyLayoutForFrame): Deleted.
1336         (PageLoaderClient::layoutMilestones const): Deleted.
1337         (PageLoaderClient::didHandleOnloadEventsForFrame): Deleted.
1338         (PageLoaderClient::userAgentForURL const): Deleted.
1339         (ResourceLoadClient::willSendRequestForFrame): Deleted.
1340         (ResourceLoadClient::didInitiateLoadForResource): Deleted.
1341         (ResourceLoadClient::didFinishLoadForResource): Deleted.
1342         (ResourceLoadClient::didFailLoadForResource): Deleted.
1343
1344 2019-02-06  Michael Catanzaro  <mcatanzaro@igalia.com>
1345
1346         REGRESSION(r240785): [SOUP] Broke cookie persistent storage
1347         https://bugs.webkit.org/show_bug.cgi?id=194209
1348
1349         Reviewed by Carlos Garcia Campos.
1350
1351         I missed a spot when moving the persistent storage parameters from NetworkProcess to
1352         NetworkSession. They have to be initialized separately for the default session.
1353
1354         * UIProcess/soup/WebProcessPoolSoup.cpp:
1355         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1356
1357 2019-02-05  Alex Christensen  <achristensen@webkit.org>
1358
1359         Stop using blobRegistry in NetworkProcess
1360         https://bugs.webkit.org/show_bug.cgi?id=194027
1361
1362         Reviewed by Youenn Fablet.
1363
1364         * NetworkProcess/Downloads/DownloadManager.cpp:
1365         (WebKit::DownloadManager::startDownload):
1366         * NetworkProcess/Downloads/PendingDownload.cpp:
1367         (WebKit::PendingDownload::PendingDownload):
1368         * NetworkProcess/Downloads/PendingDownload.h:
1369         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
1370         (WebKit::NetworkBlobRegistry::registerFileBlobURL):
1371         (WebKit::NetworkBlobRegistry::registerBlobURL):
1372         (WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked):
1373         (WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
1374         (WebKit::NetworkBlobRegistry::unregisterBlobURL):
1375         (WebKit::NetworkBlobRegistry::blobSize):
1376         (WebKit::NetworkBlobRegistry::writeBlobsToTemporaryFiles):
1377         (WebKit::NetworkBlobRegistry::writeBlobToFilePath):
1378         (WebKit::NetworkBlobRegistry::connectionToWebProcessDidClose):
1379         (WebKit::NetworkBlobRegistry::filesInBlob):
1380         (WebKit::NetworkBlobRegistry::singleton): Deleted.
1381         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
1382         (WebKit::NetworkBlobRegistry::blobRegistry):
1383         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1384         (WebKit::NetworkConnectionToWebProcess::didClose):
1385         (WebKit::NetworkConnectionToWebProcess::resolveBlobReferences):
1386         (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
1387         (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
1388         (WebKit::NetworkConnectionToWebProcess::loadPing):
1389         (WebKit::NetworkConnectionToWebProcess::preconnectTo):
1390         (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
1391         (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
1392         (WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL):
1393         (WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
1394         (WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
1395         (WebKit::NetworkConnectionToWebProcess::unregisterBlobURL):
1396         (WebKit::NetworkConnectionToWebProcess::blobSize):
1397         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
1398         (WebKit::NetworkConnectionToWebProcess::filesInBlob):
1399         (WebKit::NetworkConnectionToWebProcess::blobRegistry):
1400         * NetworkProcess/NetworkConnectionToWebProcess.h:
1401         * NetworkProcess/NetworkDataTask.cpp:
1402         (WebKit::NetworkDataTask::create):
1403         * NetworkProcess/NetworkDataTaskBlob.cpp:
1404         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
1405         * NetworkProcess/NetworkDataTaskBlob.h:
1406         * NetworkProcess/NetworkLoad.cpp:
1407         (WebKit::NetworkLoad::NetworkLoad):
1408         (WebKit::NetworkLoad::initialize):
1409         * NetworkProcess/NetworkLoad.h:
1410         * NetworkProcess/NetworkProcess.cpp:
1411         (WebKit::NetworkProcess::NetworkProcess):
1412         (WebKit::NetworkProcess::removeNetworkConnectionToWebProcess):
1413         * NetworkProcess/NetworkProcess.h:
1414         (WebKit::NetworkProcess::networkBlobRegistry):
1415         * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
1416         (WebKit::NetworkProcessPlatformStrategies::createBlobRegistry):
1417         * NetworkProcess/NetworkResourceLoader.cpp:
1418         (WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
1419         (WebKit::NetworkResourceLoader::startNetworkLoad):
1420         * NetworkProcess/PreconnectTask.cpp:
1421         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1422         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
1423
1424 2019-02-05  Daniel Bates  <dabates@apple.com>
1425
1426         Fix a typo in r241006. Substitute Modifier for Modifiers.
1427
1428         * Shared/mac/NativeWebGestureEventMac.mm:
1429         (WebKit::NativeWebGestureEvent::NativeWebGestureEvent):
1430
1431 2019-02-05  Daniel Bates  <dabates@apple.com>
1432
1433         Attempt to fix the build following r241000
1434         (https://bugs.webkit.org/show_bug.cgi?id=194241)
1435
1436         Substitute OptionSet<WebEvent::Modifier> for Modifiers.
1437
1438         * Shared/mac/NativeWebGestureEventMac.mm:
1439         (WebKit::NativeWebGestureEvent::NativeWebGestureEvent):
1440         * Shared/mac/WebGestureEvent.h:
1441         (WebKit::WebGestureEvent::WebGestureEvent):
1442
1443 2019-02-05  Truitt Savell  <tsavell@apple.com>
1444
1445         Unreviewed, rolling out r240984.
1446
1447         Revision casued two API timeouts
1448
1449         Reverted changeset:
1450
1451         "Stop using blobRegistry in NetworkProcess"
1452         https://bugs.webkit.org/show_bug.cgi?id=194027
1453         https://trac.webkit.org/changeset/240984
1454
1455 2019-02-05  Youenn Fablet  <youenn@apple.com>
1456
1457         UserMediaPermissionRequestManagerProxy lambdas should check for 'this' being valid
1458         https://bugs.webkit.org/show_bug.cgi?id=194246
1459
1460         Reviewed by Eric Carlson.
1461
1462         With PSON enabled, the manager proxy can be destroyed.
1463         It is thus important for its callbacks to check for 'this' to be valid.
1464
1465         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1466         (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
1467         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
1468         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
1469
1470 2019-02-05  Daniel Bates  <dabates@apple.com>
1471
1472         Attempt to fix the build following r241000
1473         (https://bugs.webkit.org/show_bug.cgi?id=194241)
1474
1475         Substitute WebEvent::Modifier::CapsLockKey for WebEvent::CapsLockKey.
1476
1477         * Shared/gtk/WebEventFactory.cpp:
1478         (WebKit::modifiersForEvent):
1479         * Shared/mac/WebEventFactory.mm:
1480         (WebKit::modifiersForEvent):
1481         * UIProcess/API/Cocoa/WKNavigationAction.mm:
1482         (toNSEventModifierFlags):
1483         * UIProcess/Automation/WebAutomationSession.cpp:
1484         (WebKit::protocolModifierToWebEventModifier):
1485         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
1486         (WebKit::modifiersToEventState):
1487         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
1488         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
1489         * UIProcess/Cocoa/UIDelegate.mm:
1490         (WebKit::toNSEventModifierFlags):
1491
1492 2019-02-05  Daniel Bates  <dabates@apple.com>
1493
1494         Make WebEvent::Modifiers an OptionSet
1495         https://bugs.webkit.org/show_bug.cgi?id=194241
1496
1497         Reviewed by Simon Fraser.
1498
1499         Use an OptionSet to represent the bitmask of keyboard modifier flags. This improves type safety
1500         and makes debugging more enjoyable because our LLDB pretty-printers have built-in support for
1501         OptionSet.
1502
1503         While I am at it, make WebEvent::Modifier an enum class. It is currently an enum. This makes
1504         this enum more closely match WebCore::PlatformEvent::Modifier.
1505
1506         * Shared/API/c/WKSharedAPICast.h:
1507         (WebKit::toAPI):
1508         * Shared/NavigationActionData.cpp:
1509         (WebKit::NavigationActionData::encode const):
1510         (WebKit::NavigationActionData::decode):
1511         * Shared/NavigationActionData.h:
1512         * Shared/WebEvent.cpp:
1513         (WebKit::WebEvent::WebEvent):
1514         * Shared/WebEvent.h:
1515         (WebKit::WebEvent::shiftKey const):
1516         (WebKit::WebEvent::controlKey const):
1517         (WebKit::WebEvent::altKey const):
1518         (WebKit::WebEvent::metaKey const):
1519         (WebKit::WebEvent::capsLockKey const):
1520         (WebKit::WebEvent::modifiers const):
1521         (WebKit::WebTouchEvent::WebTouchEvent):
1522         * Shared/WebEventConversion.cpp:
1523         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
1524         * Shared/WebKeyboardEvent.cpp:
1525         (WebKit::WebKeyboardEvent::WebKeyboardEvent):
1526         * Shared/WebMouseEvent.cpp:
1527         (WebKit::WebMouseEvent::WebMouseEvent):
1528         * Shared/WebTouchEvent.cpp:
1529         (WebKit::WebTouchEvent::WebTouchEvent):
1530         * Shared/WebWheelEvent.cpp:
1531         (WebKit::WebWheelEvent::WebWheelEvent):
1532         * Shared/gtk/WebEventFactory.cpp:
1533         (WebKit::modifiersForEvent):
1534         * Shared/ios/NativeWebTouchEventIOS.mm:
1535         (WebKit::NativeWebTouchEvent::NativeWebTouchEvent):
1536         * Shared/ios/WebIOSEventFactory.mm:
1537         (modifiersForEvent):
1538         (WebIOSEventFactory::createWebKeyboardEvent):
1539         (WebIOSEventFactory::createWebMouseEvent):
1540         * Shared/libwpe/WebEventFactory.cpp:
1541         (WebKit::modifiersForEventModifiers):
1542         (WebKit::WebEventFactory::createWebWheelEvent):
1543         (WebKit::WebEventFactory::createWebTouchEvent):
1544         * Shared/mac/WebEventFactory.mm:
1545         (WebKit::modifiersForEvent):
1546         (WebKit::WebEventFactory::createWebMouseEvent):
1547         (WebKit::WebEventFactory::createWebWheelEvent):
1548         (WebKit::WebEventFactory::createWebKeyboardEvent):
1549         * Shared/win/WebEventFactory.cpp:
1550         (WebKit::modifiersForEvent):
1551         (WebKit::modifiersForCurrentKeyState):
1552         (WebKit::WebEventFactory::createWebMouseEvent):
1553         (WebKit::WebEventFactory::createWebWheelEvent):
1554         (WebKit::WebEventFactory::createWebKeyboardEvent):
1555         * UIProcess/API/APINavigationAction.h:
1556         * UIProcess/API/APIUIClient.h:
1557         (API::UIClient::mouseDidMoveOverElement):
1558         * UIProcess/API/C/WKPage.cpp:
1559         (WKPageSetPageUIClient):
1560         * UIProcess/API/Cocoa/WKNavigationAction.mm:
1561         (toNSEventModifierFlags):
1562         * UIProcess/API/glib/WebKitPrivate.cpp:
1563         (toPlatformModifiers):
1564         * UIProcess/API/glib/WebKitPrivate.h:
1565         * UIProcess/API/glib/WebKitUIClient.cpp:
1566         * UIProcess/API/glib/WebKitWebView.cpp:
1567         (webkitWebViewMouseTargetChanged):
1568         * UIProcess/API/glib/WebKitWebViewPrivate.h:
1569         * UIProcess/Automation/WebAutomationSession.cpp:
1570         (WebKit::WebAutomationSession::simulateMouseInteraction):
1571         (WebKit::protocolModifierToWebEventModifier):
1572         (WebKit::WebAutomationSession::performMouseInteraction):
1573         * UIProcess/Automation/WebAutomationSession.h:
1574         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
1575         (WebKit::modifiersToEventState):
1576         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
1577         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
1578         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
1579         * UIProcess/Automation/wpe/WebAutomationSessionWPE.cpp:
1580         (WebKit::modifiersToEventState):
1581         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
1582         * UIProcess/Cocoa/UIDelegate.h:
1583         * UIProcess/Cocoa/UIDelegate.mm:
1584         (WebKit::toNSEventModifierFlags):
1585         (WebKit::UIDelegate::UIClient::mouseDidMoveOverElement):
1586         * UIProcess/WebPageProxy.cpp:
1587         (WebKit::WebPageProxy::mouseDidMoveOverElement):
1588         * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
1589         (API::InjectedBundle::PageUIClient::mouseDidMoveOverElement):
1590         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
1591         (WebKit::InjectedBundleNavigationAction::modifiersForNavigationAction):
1592         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.h:
1593         (WebKit::InjectedBundleNavigationAction::modifiers const):
1594         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
1595         (WebKit::InjectedBundlePageUIClient::mouseDidMoveOverElement):
1596         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
1597         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1598         (WebKit::PDFPlugin::showContextMenuAtPoint):
1599         * WebProcess/Plugins/PluginView.cpp:
1600         (WebKit::PluginView::createWebEvent const):
1601         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1602         (WebKit::WebChromeClient::mouseDidMoveOverElement):
1603         * WebProcess/WebPage/WebPage.cpp:
1604         (WebKit::WebPage::simulateMouseDown):
1605         (WebKit::WebPage::simulateMouseUp):
1606         (WebKit::WebPage::simulateMouseMotion):
1607
1608 2019-02-05  Tim Horton  <timothy_horton@apple.com>
1609
1610         Reproducible crash under WKShareSheet presentWithParameters when cancelling a share
1611         https://bugs.webkit.org/show_bug.cgi?id=194301
1612         <rdar://problem/47719379>
1613
1614         Reviewed by Beth Dakin.
1615
1616         * UIProcess/Cocoa/WKShareSheet.mm:
1617         (-[WKShareSheet presentWithParameters:completionHandler:]):
1618         NSSharingServicePicker's delegate callbacks can be called synchronously.
1619         We release the WKShareSheet (which holds our reference to the NSSharingServicePicker)
1620         under sharingServicePicker:didChooseSharingService:. On older versions of macOS,
1621         there was nothing keeping the NSSharingServicePicker alive inside
1622         showRelativeToRect:ofView:preferredEdge:, thus the whole chain of references would
1623         fall and result in sending a message to a released NSSharingServicePicker.
1624         To resolve this, keep an extra reference to the WKShareSheet until
1625         presentation is complete.
1626
1627 2019-02-05  Keith Rollin  <krollin@apple.com>
1628
1629         Enable the automatic checking and regenerations of .xcfilelists during builds
1630         https://bugs.webkit.org/show_bug.cgi?id=194124
1631         <rdar://problem/47721277>
1632
1633         Reviewed by Tim Horton.
1634
1635         Bug 193790 add a facility for checking -- during build time -- that
1636         any needed .xcfilelist files are up-to-date and for updating them if
1637         they are not. This facility was initially opt-in by setting
1638         WK_ENABLE_CHECK_XCFILELISTS until other pieces were in place and until
1639         the process seemed robust. Its now time to enable this facility and
1640         make it opt-out. If there is a need to disable this facility, set and
1641         export WK_DISABLE_CHECK_XCFILELISTS=1 in your environment before
1642         running `make` or `build-webkit`, or before running Xcode from the
1643         command line.
1644
1645         Additionally, remove the step that generates a list of source files
1646         going into the UnifiedSources build step. It's only necessarily to
1647         specify Sources.txt and SourcesCocoa.txt as inputs.
1648
1649         * UnifiedSources-input.xcfilelist: Removed.
1650         * WebKit.xcodeproj/project.pbxproj:
1651
1652 2019-02-05  Brady Eidson  <beidson@apple.com>
1653
1654         Add a new DownloadMap type that manages taking an assertion automatically.
1655         https://bugs.webkit.org/show_bug.cgi?id=194294
1656
1657         Reviewed by Alex Christensen.
1658
1659         If we don't need the download assertion, we use a vanilla HashMap like today.
1660         If we need the download assertion, we use the new DownloadMap class instead.
1661
1662         The new DownloadMap is a wrapper around a HashMap that also creates/destroys the assertion as needed.
1663
1664         * NetworkProcess/Downloads/DownloadManager.cpp:
1665         (WebKit::DownloadManager::dataTaskBecameDownloadTask):
1666         (WebKit::DownloadManager::downloadFinished):
1667         * NetworkProcess/Downloads/DownloadManager.h:
1668
1669         * NetworkProcess/Downloads/DownloadMap.cpp: Added.
1670         (WebKit::DownloadMap::get const):
1671         (WebKit::DownloadMap::isEmpty const):
1672         (WebKit::DownloadMap::size const):
1673         (WebKit::DownloadMap::contains const):
1674         (WebKit::DownloadMap::add):
1675         (WebKit::DownloadMap::remove):
1676         * NetworkProcess/Downloads/DownloadMap.h: Added.
1677
1678         * Sources.txt:
1679
1680         * UIProcess/ios/ProcessAssertionIOS.mm:
1681         (WebKit::ProcessAssertion::ProcessAssertion):
1682
1683         * WebKit.xcodeproj/project.pbxproj:
1684
1685 2019-02-05  Brady Eidson  <beidson@apple.com>
1686
1687         Fix iOS simulator build after r240954
1688
1689         Unreviewed.
1690
1691         * UIProcess/ios/ProcessAssertionIOS.mm:
1692         (WebKit::ProcessAssertion::ProcessAssertion): Implement the new constructor.
1693
1694 2019-02-05  Alex Christensen  <achristensen@webkit.org>
1695
1696         Stop using blobRegistry in NetworkProcess
1697         https://bugs.webkit.org/show_bug.cgi?id=194027
1698
1699         Reviewed by Youenn Fablet.
1700
1701         * NetworkProcess/Downloads/DownloadManager.cpp:
1702         (WebKit::DownloadManager::startDownload):
1703         * NetworkProcess/Downloads/PendingDownload.cpp:
1704         (WebKit::PendingDownload::PendingDownload):
1705         * NetworkProcess/Downloads/PendingDownload.h:
1706         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
1707         (WebKit::NetworkBlobRegistry::registerFileBlobURL):
1708         (WebKit::NetworkBlobRegistry::registerBlobURL):
1709         (WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked):
1710         (WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
1711         (WebKit::NetworkBlobRegistry::unregisterBlobURL):
1712         (WebKit::NetworkBlobRegistry::blobSize):
1713         (WebKit::NetworkBlobRegistry::writeBlobsToTemporaryFiles):
1714         (WebKit::NetworkBlobRegistry::writeBlobToFilePath):
1715         (WebKit::NetworkBlobRegistry::connectionToWebProcessDidClose):
1716         (WebKit::NetworkBlobRegistry::filesInBlob):
1717         (WebKit::NetworkBlobRegistry::singleton): Deleted.
1718         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
1719         (WebKit::NetworkBlobRegistry::blobRegistry):
1720         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1721         (WebKit::NetworkConnectionToWebProcess::didClose):
1722         (WebKit::NetworkConnectionToWebProcess::resolveBlobReferences):
1723         (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
1724         (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
1725         (WebKit::NetworkConnectionToWebProcess::loadPing):
1726         (WebKit::NetworkConnectionToWebProcess::preconnectTo):
1727         (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
1728         (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
1729         (WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL):
1730         (WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
1731         (WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
1732         (WebKit::NetworkConnectionToWebProcess::unregisterBlobURL):
1733         (WebKit::NetworkConnectionToWebProcess::blobSize):
1734         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
1735         (WebKit::NetworkConnectionToWebProcess::filesInBlob):
1736         (WebKit::NetworkConnectionToWebProcess::blobRegistry):
1737         * NetworkProcess/NetworkConnectionToWebProcess.h:
1738         * NetworkProcess/NetworkDataTask.cpp:
1739         (WebKit::NetworkDataTask::create):
1740         * NetworkProcess/NetworkDataTaskBlob.cpp:
1741         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
1742         * NetworkProcess/NetworkDataTaskBlob.h:
1743         * NetworkProcess/NetworkLoad.cpp:
1744         (WebKit::NetworkLoad::NetworkLoad):
1745         (WebKit::NetworkLoad::initialize):
1746         * NetworkProcess/NetworkLoad.h:
1747         * NetworkProcess/NetworkProcess.cpp:
1748         (WebKit::NetworkProcess::NetworkProcess):
1749         (WebKit::NetworkProcess::removeNetworkConnectionToWebProcess):
1750         * NetworkProcess/NetworkProcess.h:
1751         (WebKit::NetworkProcess::networkBlobRegistry):
1752         * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
1753         (WebKit::NetworkProcessPlatformStrategies::createBlobRegistry):
1754         * NetworkProcess/NetworkResourceLoader.cpp:
1755         (WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
1756         (WebKit::NetworkResourceLoader::startNetworkLoad):
1757         * NetworkProcess/PreconnectTask.cpp:
1758         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1759         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
1760
1761 2019-02-05  Ryan Haddad  <ryanhaddad@apple.com>
1762
1763         Unreviewed, rolling out r240742.
1764
1765         Causes crashes on iOS simulator.
1766
1767         Reverted changeset:
1768
1769         "[iOS] Keyups for non-modifier keys identified as "Dead" when
1770         not focused in a content-editable element"
1771         https://bugs.webkit.org/show_bug.cgi?id=192824
1772         https://trac.webkit.org/changeset/240742
1773
1774 2019-02-05  Alex Christensen  <achristensen@webkit.org>
1775
1776         Protect globalWebSocketStreamMap with a Lock
1777         https://bugs.webkit.org/show_bug.cgi?id=194224
1778         <rdar://problem/47581081>
1779
1780         Reviewed by Ryosuke Niwa.
1781
1782         * WebProcess/Network/WebSocketStream.cpp:
1783         (WebKit::WebSocketStream::streamWithIdentifier):
1784         (WebKit::WebSocketStream::networkProcessCrashed):
1785         (WebKit::WebSocketStream::WebSocketStream):
1786         (WebKit::WebSocketStream::~WebSocketStream):
1787
1788 2019-02-04  Alex Christensen  <achristensen@webkit.org>
1789
1790         Add Networking Daemon skeleton
1791         https://bugs.webkit.org/show_bug.cgi?id=194278
1792
1793         Reviewed by Zalan Bujtas.
1794
1795         Daemon skeletons? This is spooky stuff.
1796
1797         * NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.h: Added.
1798         * NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm: Added.
1799         (WebKit::DaemonMain):
1800         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
1801         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1802         (WebKit::NetworkDataTaskCocoa::restrictRequestReferrerToOriginIfNeeded):
1803         * Shared/API/Cocoa/WKMain.h:
1804         * Shared/API/Cocoa/WKMain.mm:
1805         (WKDaemonMain):
1806         * Shared/EntryPointUtilities/Cocoa/AuxiliaryProcessMain.cpp:
1807         (main):
1808         * SourcesCocoa.txt:
1809         * UnifiedSources-input.xcfilelist:
1810         * WebKit.xcodeproj/project.pbxproj:
1811
1812 2019-02-04  Yusuke Suzuki  <ysuzuki@apple.com>
1813
1814         [JSC] Shrink size of VM by lazily allocating IsoSubspaces for non-common types
1815         https://bugs.webkit.org/show_bug.cgi?id=193993
1816
1817         Reviewed by Keith Miller.
1818
1819         * WebProcess/Plugins/Netscape/JSNPMethod.h:
1820         * WebProcess/Plugins/Netscape/JSNPObject.h:
1821
1822 2019-02-04  Simon Fraser  <simon.fraser@apple.com>
1823
1824         Move some macOS/iOS scrolling code into the scrolling/cocoa directory
1825         https://bugs.webkit.org/show_bug.cgi?id=194245
1826
1827         Reviewed by Zalan Bujtas.
1828
1829         Use PLATFORM(MAC), not !PLATFORM(IOS_FAMILY).
1830
1831         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
1832         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1833
1834 2019-02-04  Ms2ger  <Ms2ger@igalia.com>
1835
1836         [GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
1837         https://bugs.webkit.org/show_bug.cgi?id=174816
1838
1839         Reviewed by Michael Catanzaro.
1840
1841         Add webkit_uri_for_display for GTK and WPE.
1842
1843         * PlatformGTK.cmake:
1844         * PlatformWPE.cmake:
1845         * SourcesGTK.txt:
1846         * SourcesWPE.txt:
1847         * UIProcess/API/glib/WebKitURIUtilities.cpp: Added.
1848         (webkit_uri_for_display):
1849         * UIProcess/API/gtk/WebKitURIUtilities.h: Added.
1850         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1851         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
1852         * UIProcess/API/gtk/webkit2.h:
1853         * UIProcess/API/wpe/WebKitURIUtilities.h: Added.
1854         * UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
1855         * UIProcess/API/wpe/docs/wpe-docs.sgml:
1856         * UIProcess/API/wpe/webkit.h:
1857
1858 2019-02-04  Alex Christensen  <achristensen@webkit.org>
1859
1860         Move XPCService main to a shared file calling a C function
1861         https://bugs.webkit.org/show_bug.cgi?id=194256
1862
1863         Reviewed by Brady Eidson.
1864
1865         This not only reduces a few kilobytes of duplicated binary from the XPCService executables,
1866         It will allow me to introduce a new kind of executable which will need to parse argv and call a different C function.
1867         This is similar to r236075 but more general.
1868
1869         * Shared/API/Cocoa/WKMain.h: Added.
1870         * Shared/API/Cocoa/WKMain.mm: Added.
1871         (WKXPCServiceMain):
1872         * Shared/EntryPointUtilities/Cocoa/AuxiliaryProcessMain.cpp: Added.
1873         (main):
1874         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
1875         (main): Deleted.
1876         * SourcesCocoa.txt:
1877         * WebKit.xcodeproj/project.pbxproj:
1878
1879 2019-02-04  Alex Christensen  <achristensen@webkit.org>
1880
1881         Make MessageSender functions const
1882         https://bugs.webkit.org/show_bug.cgi?id=194247
1883
1884         Reviewed by Brady Eidson.
1885
1886         * NetworkProcess/Downloads/Download.cpp:
1887         (WebKit::Download::messageSenderConnection const):
1888         (WebKit::Download::messageSenderDestinationID const):
1889         (WebKit::Download::messageSenderConnection): Deleted.
1890         (WebKit::Download::messageSenderDestinationID): Deleted.
1891         * NetworkProcess/Downloads/Download.h:
1892         * NetworkProcess/Downloads/PendingDownload.cpp:
1893         (WebKit::PendingDownload::messageSenderConnection const):
1894         (WebKit::PendingDownload::messageSenderDestinationID const):
1895         (WebKit::PendingDownload::messageSenderConnection): Deleted.
1896         (WebKit::PendingDownload::messageSenderDestinationID): Deleted.
1897         * NetworkProcess/Downloads/PendingDownload.h:
1898         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1899         (WebKit::WebIDBConnectionToClient::messageSenderConnection const):
1900         (WebKit::WebIDBConnectionToClient::messageSenderConnection): Deleted.
1901         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
1902         * NetworkProcess/NetworkResourceLoader.cpp:
1903         (WebKit::NetworkResourceLoader::messageSenderConnection const):
1904         (WebKit::NetworkResourceLoader::messageSenderConnection): Deleted.
1905         * NetworkProcess/NetworkResourceLoader.h:
1906         * NetworkProcess/NetworkSocketStream.cpp:
1907         (WebKit::NetworkSocketStream::messageSenderConnection const):
1908         (WebKit::NetworkSocketStream::messageSenderDestinationID const):
1909         (WebKit::NetworkSocketStream::messageSenderConnection): Deleted.
1910         (WebKit::NetworkSocketStream::messageSenderDestinationID): Deleted.
1911         * NetworkProcess/NetworkSocketStream.h:
1912         * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
1913         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
1914         (WebKit::WebSWServerToContextConnection::messageSenderConnection const):
1915         (WebKit::WebSWServerToContextConnection::messageSenderDestinationID const):
1916         (WebKit::WebSWServerToContextConnection::messageSenderConnection): Deleted.
1917         (WebKit::WebSWServerToContextConnection::messageSenderDestinationID): Deleted.
1918         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
1919         * Platform/IPC/MessageSender.h:
1920         * Shared/AuxiliaryProcess.cpp:
1921         (WebKit::AuxiliaryProcess::messageSenderConnection const):
1922         (WebKit::AuxiliaryProcess::messageSenderDestinationID const):
1923         (WebKit::AuxiliaryProcess::messageSenderConnection): Deleted.
1924         (WebKit::AuxiliaryProcess::messageSenderDestinationID): Deleted.
1925         * Shared/AuxiliaryProcess.h:
1926         * UIProcess/WebConnectionToWebProcess.cpp:
1927         (WebKit::WebConnectionToWebProcess::messageSenderConnection const):
1928         (WebKit::WebConnectionToWebProcess::messageSenderDestinationID const):
1929         (WebKit::WebConnectionToWebProcess::messageSenderConnection): Deleted.
1930         (WebKit::WebConnectionToWebProcess::messageSenderDestinationID): Deleted.
1931         * UIProcess/WebConnectionToWebProcess.h:
1932         * UIProcess/WebPageProxy.cpp:
1933         (WebKit::WebPageProxy::messageSenderConnection const):
1934         (WebKit::WebPageProxy::messageSenderDestinationID const):
1935         (WebKit::WebPageProxy::messageSenderConnection): Deleted.
1936         (WebKit::WebPageProxy::messageSenderDestinationID): Deleted.
1937         * UIProcess/WebPageProxy.h:
1938         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1939         (WebKit::WebIDBConnectionToServer::messageSenderConnection const):
1940         (WebKit::WebIDBConnectionToServer::messageSenderConnection): Deleted.
1941         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
1942         * WebProcess/Network/WebResourceLoader.cpp:
1943         (WebKit::WebResourceLoader::messageSenderConnection const):
1944         (WebKit::WebResourceLoader::messageSenderDestinationID const):
1945         (WebKit::WebResourceLoader::messageSenderConnection): Deleted.
1946         (WebKit::WebResourceLoader::messageSenderDestinationID): Deleted.
1947         * WebProcess/Network/WebResourceLoader.h:
1948         * WebProcess/Network/WebSocketStream.cpp:
1949         (WebKit::WebSocketStream::messageSenderConnection const):
1950         (WebKit::WebSocketStream::messageSenderDestinationID const):
1951         (WebKit::WebSocketStream::messageSenderConnection): Deleted.
1952         (WebKit::WebSocketStream::messageSenderDestinationID): Deleted.
1953         * WebProcess/Network/WebSocketStream.h:
1954         * WebProcess/Storage/WebSWClientConnection.h:
1955         * WebProcess/WebConnectionToUIProcess.cpp:
1956         (WebKit::WebConnectionToUIProcess::messageSenderConnection const):
1957         (WebKit::WebConnectionToUIProcess::messageSenderDestinationID const):
1958         (WebKit::WebConnectionToUIProcess::messageSenderConnection): Deleted.
1959         (WebKit::WebConnectionToUIProcess::messageSenderDestinationID): Deleted.
1960         * WebProcess/WebConnectionToUIProcess.h:
1961         * WebProcess/WebPage/WebPage.cpp:
1962         (WebKit::WebPage::messageSenderConnection const):
1963         (WebKit::WebPage::messageSenderDestinationID const):
1964         (WebKit::WebPage::messageSenderConnection): Deleted.
1965         (WebKit::WebPage::messageSenderDestinationID): Deleted.
1966         * WebProcess/WebPage/WebPage.h:
1967
1968 2019-02-04  Brady Eidson  <beidson@apple.com>
1969
1970         Take additional process assertion while downloading.
1971         <rdar://problem/47741356> and https://bugs.webkit.org/show_bug.cgi?id=194239
1972
1973         Reviewed by Chris Dumez.
1974
1975         When the first download starts, grab this new assertion.
1976         When the last download ends, release it.
1977
1978         * Configurations/Network-iOS.entitlements:
1979
1980         * NetworkProcess/Downloads/DownloadManager.cpp:
1981         (WebKit::DownloadManager::dataTaskBecameDownloadTask):
1982         (WebKit::DownloadManager::downloadFinished):
1983         * NetworkProcess/Downloads/DownloadManager.h:
1984
1985         * Platform/spi/ios/AssertionServicesSPI.h:
1986
1987         * UIProcess/ProcessAssertion.cpp:
1988         (WebKit::ProcessAssertion::ProcessAssertion):
1989         * UIProcess/ProcessAssertion.h:
1990         (WebKit::ProcessAssertion::ProcessAssertion):
1991
1992         * UIProcess/WebProcessProxy.cpp:
1993         (WebKit::WebProcessProxy::didSetAssertionState):
1994
1995         * UIProcess/ios/ProcessAssertionIOS.mm:
1996         (WebKit::flagsForState):
1997         (WebKit::reasonForState):
1998         (WebKit::ProcessAssertion::ProcessAssertion):
1999
2000 2019-02-04  Said Abou-Hallawa  <said@apple.com>
2001
2002         [CG] Enable setAdditionalSupportedImageTypes for WK1
2003         https://bugs.webkit.org/show_bug.cgi?id=194190
2004
2005         Reviewed by Tim Horton.
2006
2007         Move the function webCoreStringVectorFromNSStringArray from WebKit to
2008         WebCore so it can be used by both WebKit and WebKitLegacy.
2009
2010         * Platform/mac/StringUtilities.h:
2011         * Platform/mac/StringUtilities.mm:
2012         (WebKit::webCoreStringVectorFromNSStringArray): Deleted.
2013         * UIProcess/API/Cocoa/WKWebView.mm:
2014         (-[WKWebView _initializeWithConfiguration:]):
2015
2016 2019-02-04  Benjamin Poulain  <benjamin@webkit.org>
2017
2018         Use deferrable timer to restart the Responsiveness Timer on each wheel event
2019         https://bugs.webkit.org/show_bug.cgi?id=194135
2020
2021         Reviewed by Simon Fraser.
2022
2023         Simon Fraser suggested a neat improvement over my previous optimization
2024         of ResponsivenessTimer.
2025
2026         Instead of reseting the deadline with every event, we can let the timer
2027         fire and add the missing time from the last start.
2028
2029         I implemented that behavior in the new Deferrable Timer class and use
2030         it from ResponsivenessTimer.
2031
2032         * NetworkProcess/watchos/NetworkProximityAssertion.h:
2033         * UIProcess/ResponsivenessTimer.h:
2034         * WebProcess/Plugins/PluginView.h:
2035
2036 2019-02-04  Simon Fraser  <simon.fraser@apple.com>
2037
2038         PageOverlayController's layers should be created lazily
2039         https://bugs.webkit.org/show_bug.cgi?id=194199
2040         rdar://problem/46571593
2041
2042         Reviewed by Tim Horton.
2043         
2044         Expose PageOverlayController::hasDocumentOverlays() and hasViewOverlays()
2045         and use them to only parent the overlay-hosting layers when necessary.
2046
2047         For document overlays, RenderLayerCompositor::appendDocumentOverlayLayers() can
2048         simply do nothing if there are none. Updates are triggered via Page::installedPageOverlaysChanged(),
2049         which calls FrameView::setNeedsCompositingConfigurationUpdate() to trigger the root layer
2050         compositing updates that parents the layerWithDocumentOverlays().
2051
2052         View overlays are added to the layer tree via the DrawingArea. When we go between having
2053         none and some view overlays, Page::installedPageOverlaysChanged() calls attachViewOverlayGraphicsLayer()
2054         on the ChromeClient, and the DrawingArea responds by calling updateRootLayers() and scheduling a
2055         compositing flush (this has to be done manually because view overlay layers are outside the
2056         subtree managed by RenderLayerCompositor).
2057         
2058         Now that GraphicsLayers are ref-counted, we can let the DrawingArea simply retain its m_viewOverlayRootLayer;
2059         there is no need for RenderLayerCompositor::attachRootLayer()/detachRootLayer() to do anything with view
2060         overlay layers. This implies that a page can navigate (new FrameView) and view overlays will persist, without
2061         having to be manually removed and re-added. We can also remove the Frame argument to attachViewOverlayGraphicsLayer().
2062
2063         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2064         (WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
2065         * WebProcess/WebCoreSupport/WebChromeClient.h:
2066         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
2067         (WebKit::AcceleratedDrawingArea::attachViewOverlayGraphicsLayer):
2068         * WebProcess/WebPage/AcceleratedDrawingArea.h:
2069         * WebProcess/WebPage/DrawingArea.h:
2070         (WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
2071         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
2072         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
2073         (WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
2074         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2075         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2076         (WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
2077         (WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
2078
2079 2019-02-04  Michael Catanzaro  <mcatanzaro@igalia.com>
2080
2081         Unreviewed, improve preprocessor guard
2082         https://bugs.webkit.org/show_bug.cgi?id=194166
2083         <rdar://problem/47694328>
2084
2085         AC mode is only optional in GTK port. Requested by Zan.
2086
2087         * WebProcess/WebPage/WebPage.cpp:
2088         (WebKit::WebPage::updatePreferences):
2089
2090 2019-02-04  Sihui Liu  <sihui_liu@apple.com>
2091
2092         IndexedDB: leak WebIDBConnectionToServer in layout tests
2093         https://bugs.webkit.org/show_bug.cgi?id=193688
2094         <rdar://problem/47353263>
2095
2096         Reviewed by Geoffrey Garen.
2097
2098         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2099         (WebKit::NetworkConnectionToWebProcess::didClose):
2100         (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
2101         (WebKit::NetworkConnectionToWebProcess::removeIDBConnectionToServer): Deleted.
2102         * NetworkProcess/NetworkConnectionToWebProcess.h:
2103         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2104         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
2105         (WebKit::WebIDBConnectionToServer::~WebIDBConnectionToServer):
2106
2107 2019-02-04  Antoine Quint  <graouts@apple.com>
2108
2109         <rdar://problem/47788802>
2110
2111         Unreviewed build fix.
2112
2113         * Platform/spi/ios/UIKitSPI.h:
2114
2115 2019-02-04  Youenn Fablet  <youenn@apple.com>
2116
2117         Capture state should be managed consistently when doing process swapping
2118         https://bugs.webkit.org/show_bug.cgi?id=194122
2119         <rdar://problem/47609293>
2120
2121         Reviewed by Eric Carlson.
2122
2123         When doing PSON, WebPageProxy::resetState is called.
2124         It resets the media state, but does not call the client delegates.
2125         Instead of directly updating the media state, call the routine used to update it so that client delegates are called.
2126
2127         Covered by new API test and layout test.
2128
2129         * UIProcess/API/Cocoa/WKWebView.mm:
2130         (-[WKWebView _mediaCaptureState]):
2131         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2132         * UIProcess/WebPageProxy.cpp:
2133         (WebKit::WebPageProxy::resetState):
2134         (WebKit::WebPageProxy::isPlayingMediaDidChange):
2135         (WebKit::WebPageProxy::updatePlayingMediaDidChange):
2136         * UIProcess/WebPageProxy.h:
2137
2138 2019-02-04  Antoine Quint  <graouts@apple.com>
2139
2140         Use a dedicated type instead of int32_t for pointer identifiers
2141         https://bugs.webkit.org/show_bug.cgi?id=194217
2142
2143         Reviewed by Antti Koivisto.
2144
2145         * Scripts/webkit/messages.py:
2146         * UIProcess/WebPageProxy.cpp:
2147         (WebKit::WebPageProxy::cancelPointer):
2148         * UIProcess/WebPageProxy.h:
2149         * WebProcess/WebPage/WebPage.cpp:
2150         (WebKit::WebPage::cancelPointer):
2151         * WebProcess/WebPage/WebPage.h:
2152         * WebProcess/WebPage/WebPage.messages.in:
2153
2154 2019-02-04  Michael Catanzaro  <mcatanzaro@igalia.com>
2155
2156         Unreviewed, avoid -Wswitch warnings introduced in r240880
2157         https://bugs.webkit.org/show_bug.cgi?id=193740
2158         <rdar://problem/47527267>
2159
2160         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2161         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse):
2162
2163 2019-02-04  Alexander Mikhaylenko  <exalm7659@gmail.com>
2164
2165         [GTK] Allow pinch zoom on touchpad
2166         https://bugs.webkit.org/show_bug.cgi?id=194201
2167
2168         Reviewed by Michael Catanzaro.
2169
2170         Enable touchpad events for WebkitWebViewBase, then feed touchpad
2171         pinch events to GestureController.
2172
2173         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2174         (webkitWebViewBaseRealize): Added GDK_TOUCHPAD_GESTURE_MASK to event mask.
2175         (webkitWebViewBaseEvent): Added.
2176         (webkit_web_view_base_class_init): Override event vfunc.
2177
2178 2019-02-04  Michael Catanzaro  <mcatanzaro@igalia.com>
2179
2180         Unreviewed, only force settings.acceleratedCompositingEnabled() to true for Cocoa ports
2181         https://bugs.webkit.org/show_bug.cgi?id=194166
2182         <rdar://problem/47694328>
2183
2184         Accelerated compositing is broken for me at least. We're a long way from being able to force
2185         it.
2186
2187         * WebProcess/WebPage/WebPage.cpp:
2188         (WebKit::WebPage::updatePreferences):
2189
2190 2019-02-04  Abderrahim Kitouni  <akitouni@gnome.org>
2191
2192         [GTK] Remove last python2 dependency from CMake build process
2193         https://bugs.webkit.org/show_bug.cgi?id=194218
2194
2195         Reviewed by Michael Catanzaro.
2196
2197         * InspectorGResources.cmake:
2198
2199 2019-02-04  Antti Koivisto  <antti@apple.com>
2200
2201         Rename GraphicsLayer and PlatformCALayer type enum values to match "scroll container layer" convention
2202         https://bugs.webkit.org/show_bug.cgi?id=194215
2203
2204         Reviewed by Frédéric Wang.
2205
2206         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
2207         (WebKit::RemoteLayerBackingStore::drawInContext):
2208         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
2209         (WebKit::RemoteLayerTreeHost::makeNode):
2210         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
2211         (WebKit::RemoteLayerTreeHost::makeNode):
2212
2213 2019-02-03  Antti Koivisto  <antti@apple.com>
2214
2215         [iOS] Tiles not created in large scrollable iframes
2216         https://bugs.webkit.org/show_bug.cgi?id=193665
2217
2218         Reviewed by Simon Fraser.
2219
2220         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
2221         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
2222         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
2223         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateBeforeChildren):
2224
2225         We now use scrollContainerLayer consistently so remove the special cases.
2226
2227 2019-02-03  Fujii Hironori  <Hironori.Fujii@sony.com>
2228
2229         [curl] [WebKit] Assertion failures of missing networkStorageSession for storage/indexeddb tests
2230         https://bugs.webkit.org/show_bug.cgi?id=194141
2231
2232         Reviewed by Ross Kirsling.
2233
2234         Implemented WebKit::NetworkProcess::switchToNewTestingSession and
2235         WebKit::NetworkProcess::ensureSession for curl port.
2236
2237         * NetworkProcess/NetworkProcess.cpp:
2238         (WebKit::NetworkProcess::switchToNewTestingSession):
2239         (WebKit::NetworkProcess::ensureSession):
2240
2241 2019-02-03  Simon Fraser  <simon.fraser@apple.com>
2242
2243         Make setNeedsLayout on the root more explicitly about triggering its side-effects
2244         https://bugs.webkit.org/show_bug.cgi?id=194198
2245
2246         Reviewed by Antti Koivisto.
2247
2248         Call the newly named functions.
2249
2250         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2251         (WebKit::PDFPlugin::updateScrollbars):
2252         * WebProcess/Plugins/PluginView.cpp:
2253         (WebKit::PluginView::didInitializePlugin):
2254         * WebProcess/WebPage/WebPage.cpp:
2255         (WebKit::WebPage::setHeaderBannerHeightForTesting):
2256         (WebKit::WebPage::setFooterBannerHeightForTesting):
2257         * WebProcess/WebPage/mac/PageBannerMac.mm:
2258         (WebKit::PageBanner::addToPage):
2259         (WebKit::PageBanner::detachFromPage):
2260         (WebKit::PageBanner::hide):
2261
2262 2019-02-03  Ryosuke Niwa  <rniwa@webkit.org>
2263
2264         Validate navigation policy decisions to avoid crashes in continueLoadAfterNavigationPolicy
2265         https://bugs.webkit.org/show_bug.cgi?id=194189
2266
2267         Reviewed by Geoffrey Garen.
2268
2269         Pass the policy check identifier around functions and store it in PolicyDecisionSender
2270         so that we can send it back to WebCore with the navigation policy decision.
2271
2272         We also store it in WebFrame in the case the policy decision had to be invalidated
2273         before the decision was received (via WebFrame::invalidatePolicyListener).
2274
2275         * Scripts/webkit/messages.py:
2276         * UIProcess/ProvisionalPageProxy.cpp:
2277         (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
2278         (WebKit::ProvisionalPageProxy::decidePolicyForResponse):
2279         * UIProcess/ProvisionalPageProxy.h:
2280         * UIProcess/WebPageProxy.cpp:
2281         (WebKit::WebPageProxy::PolicyDecisionSender): Added PolicyCheckIdentifier as a member.
2282         (WebKit::WebPageProxy::PolicyDecisionSender::create):
2283         (WebKit::WebPageProxy::PolicyDecisionSender::send):
2284         (WebKit::WebPageProxy::PolicyDecisionSender::PolicyDecisionSender):
2285         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
2286         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
2287         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
2288         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2289         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
2290         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
2291         (WebKit::WebPageProxy::decidePolicyForResponse):
2292         (WebKit::WebPageProxy::decidePolicyForResponseShared):
2293         * UIProcess/WebPageProxy.h:
2294         * UIProcess/WebPageProxy.messages.in:
2295         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2296         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
2297         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
2298         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2299         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2300         * WebProcess/WebPage/WebFrame.cpp:
2301         (WebKit::WebFrame::setUpPolicyListener):
2302         (WebKit::WebFrame::invalidatePolicyListener):
2303         (WebKit::WebFrame::didReceivePolicyDecision):
2304         * WebProcess/WebPage/WebFrame.h:
2305         * WebProcess/WebPage/WebPage.cpp:
2306         (WebKit::WebPage::didReceivePolicyDecision):
2307         * WebProcess/WebPage/WebPage.h:
2308         * WebProcess/WebPage/WebPage.messages.in:
2309
2310 2019-02-03  Megan Gardner  <megan_gardner@apple.com>
2311
2312         Turn on Smart Paste
2313         https://bugs.webkit.org/show_bug.cgi?id=193786
2314
2315         Reviewed by Ryosuke Niwa.
2316
2317         * Platform/spi/ios/UIKitSPI.h:
2318         * UIProcess/ios/TextCheckerIOS.mm:
2319         (WebKit::TextChecker::isSmartInsertDeleteEnabled):
2320         Use the flag from UIKit to determine if smart copy paste should be
2321         turned on.
2322
2323 2019-02-02  Simon Fraser  <simon.fraser@apple.com>
2324
2325         Tidy up data memebers of FrameView and related classes to shrink class sizes
2326         https://bugs.webkit.org/show_bug.cgi?id=194197
2327
2328         Reviewed by Zalan Bujtas.
2329
2330         * UIProcess/PageClient.h: Declare enum size.
2331
2332 2018-12-16  Darin Adler  <darin@apple.com>
2333
2334         Convert additional String::format clients to alternative approaches
2335         https://bugs.webkit.org/show_bug.cgi?id=192746
2336
2337         Reviewed by Alexey Proskuryakov.
2338
2339         * UIProcess/Cocoa/ViewGestureController.cpp:
2340         (WebKit::ViewGestureController::SnapshotRemovalTracker::startWatchdog):
2341         Use makeString and FormattedNumber.
2342
2343         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
2344         (WebKit::LocalAuthenticator::getAssertion): Added a comment about an
2345         incorrect format specifier and left this code as is for now.
2346
2347 2019-02-01  David Kilzer  <ddkilzer@apple.com>
2348
2349         Move soft-linking of TelephonyUtilities.framework out of TUCallSPI.h
2350         <https://webkit.org/b/193866>
2351
2352         Reviewed by Alex Christensen.
2353
2354         * Platform/mac/MenuUtilities.mm:
2355         - Update for rename of TUCallSPI.h to TelephonyUtilitiesSPI.h.
2356         - Add soft-linking code formerly in TUCallSPI.h.
2357
2358 2019-02-01  Alex Christensen  <achristensen@webkit.org>
2359
2360         Move XPCService entry points from mac directory to new Cocoa directory
2361         https://bugs.webkit.org/show_bug.cgi?id=194129
2362
2363         Reviewed by Chris Dumez.
2364
2365         * Configurations/NetworkService.xcconfig:
2366         * Configurations/PluginService.64.xcconfig:
2367         * Configurations/WebContentService.xcconfig:
2368         * NetworkProcess/EntryPoint/Cocoa: Copied from Source/WebKit/NetworkProcess/EntryPoint/mac.
2369         * NetworkProcess/EntryPoint/mac: Removed.
2370         * PluginProcess/EntryPoint/Cocoa: Copied from Source/WebKit/PluginProcess/EntryPoint/mac.
2371         * PluginProcess/EntryPoint/mac: Removed.
2372         * Shared/EntryPointUtilities/Cocoa: Copied from Source/WebKit/Shared/EntryPointUtilities/mac.
2373         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
2374         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm:
2375         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
2376         * Shared/EntryPointUtilities/mac: Removed.
2377         * SourcesCocoa.txt:
2378         * WebKit.xcodeproj/project.pbxproj:
2379         * WebProcess/EntryPoint/Cocoa: Copied from Source/WebKit/WebProcess/EntryPoint/mac.
2380         * WebProcess/EntryPoint/mac: Removed.
2381
2382 2019-02-01  Wenson Hsieh  <wenson_hsieh@apple.com>
2383
2384         [iOS] Consistent 1 sec hang when triggering modal alerts while handling synchronous touch events
2385         https://bugs.webkit.org/show_bug.cgi?id=194140
2386         <rdar://problem/47728098>
2387
2388         Reviewed by Tim Horton.
2389
2390         Currently, the UI process hangs when attempting to synchronously present modal UI from the web process while the
2391         UI process is waiting for sync IPC in the web process. While we have logic to generally mitigate IPC deadlock in
2392         this scenario by dispatching the web process' sync IPC immediately with the intention of allowing the web
2393         process to finish processing sync IPC (and consequently unblock the UI process), this fails in the case where
2394         the sync IPC message from the web process to the UI process requires main thread execution for an arbitrary
2395         amount of time (for instance, modal alert dialogs). In this case, we'll end up in a state where we've handled
2396         the web process' sync IPC in the UI process, yet we can't resume execution since the web process is still
2397         blocked.
2398
2399         By far the most egregious scenario in which this manifests is during synchronous gesture recognizer IPC, i.e.
2400         grabbing position information from the UI process, and handling touch events synchronously. Luckily, these are
2401         also cases where (1) we know sync IPC may safely time out, and (2) the presentation of modal UI from the web
2402         process should cause the gesture recognizers to fail anyways. As such, we can mitigate these scenarios in the
2403         web process by responding to the these pending sync IPC messages *before* sending our own sync IPC to the UI
2404         process.
2405
2406         Test: fast/events/touch/ios/show-modal-alert-during-touch-start.html
2407
2408         * Shared/ios/InteractionInformationAtPosition.h:
2409         (WebKit::InteractionInformationAtPosition::invalidInformation):
2410         * Shared/ios/InteractionInformationAtPosition.mm:
2411         (WebKit::InteractionInformationAtPosition::encode const):
2412         (WebKit::InteractionInformationAtPosition::decode):
2413
2414         Add a new flag to indicate whether an interaction information response can be valid. Interaction information
2415         cannot be valid in the case where the interaction information request was interrupted by certain sync IPC
2416         messages from the web process.
2417
2418         * UIProcess/API/C/WKContextConfigurationRef.cpp:
2419         (WKContextConfigurationIgnoreSynchronousMessagingTimeoutsForTesting):
2420         (WKContextConfigurationSetIgnoreSynchronousMessagingTimeoutsForTesting):
2421
2422         Add some testing SPI to ignore sync IPC timeouts, for the purposes of testing. Rather than use the existing
2423         Objective-C SPI in WKWebProcessPoolConfiguration, I decided to add C API plumbing for this flag, so that other
2424         non-Cocoa ports may also support the new layout test option to ignore sync IPC timeouts.
2425
2426         * UIProcess/API/C/WKContextConfigurationRef.h:
2427         * UIProcess/ios/WKContentViewInteraction.mm:
2428         (-[WKContentView ensurePositionInformationIsUpToDate:]):
2429         (-[WKContentView _positionInformationDidChange:]):
2430         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2431         (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel):
2432         (WebKit::WebChromeClient::runJavaScriptAlert):
2433         (WebKit::WebChromeClient::runJavaScriptConfirm):
2434         (WebKit::WebChromeClient::runJavaScriptPrompt):
2435         (WebKit::WebChromeClient::print):
2436         (WebKit::WebChromeClient::exceededDatabaseQuota):
2437         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
2438
2439         Cancel any pending sync IPC replies prior to sending sync IPC messages to the UI process which may result in
2440         sync IPC deadlock, by using the new helper method, sendSyncWithDelayedReply, instead of just sendSync.
2441
2442         * WebProcess/WebPage/WebPage.cpp:
2443         (WebKit::WebPage::cancelGesturesBlockedOnSynchronousReplies):
2444
2445         Add a helper to cancel pending sync messages coming in from the UI process that are being called from within
2446         gesture recognizer delegate hooks.
2447
2448         (WebKit::WebPage::touchEventSync):
2449         * WebProcess/WebPage/WebPage.h:
2450
2451         Add a new helper, sendSyncWithDelayedReply, to be used when sending a sync IPC message to the UI process that
2452         cannot be immediately completed upon arrival. Importantly, this cancels pending sync replies, and also passes
2453         IPC::SendSyncOption::InformPlatformProcessWillSuspend.
2454
2455         * WebProcess/WebPage/WebPage.messages.in:
2456
2457         Change these from LegacySync to Delayed messages.
2458
2459         * WebProcess/WebPage/ios/WebPageIOS.mm:
2460         (WebKit::WebPage::getPositionInformation):
2461
2462         Make this sync IPC handler (as well as WebPage::touchEventSync) store the IPC reply during the scope of the
2463         method, and invoke the stored reply at the end of the method if it wasn't interrupted due to something calling
2464         cancelGesturesBlockedOnSynchronousReplies().
2465
2466         (WebKit::WebPage::positionInformation):
2467
2468         Refactor getPositionInformation by pulling out the logic for building an InteractionInformationAtPosition into
2469         a separate helper.
2470
2471         (WebKit::WebPage::requestPositionInformation):
2472
2473 2019-02-01  David Quesada  <david_quesada@apple.com>
2474
2475         Network Process crash when resuming downloads: '-[__NSDictionaryI setObject:forKey:]: unrecognized selector sent to instance %p'
2476         https://bugs.webkit.org/show_bug.cgi?id=194144
2477         rdar://problem/47553456
2478
2479         Reviewed by Geoffrey Garen.
2480
2481         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
2482         (WebKit::Download::resume):
2483             Make a mutable copy of the root object decoded from the resume data.
2484             It might have been originally encoded as an immutable dictionary.
2485
2486 2019-02-01  Chris Dumez  <cdumez@apple.com>
2487
2488         REGRESSION: Flaky ASSERTION FAILED: m_uncommittedState.state == State::Committed on http/tests/cookies/same-site/fetch-after-top-level-navigation-initiated-from-iframe-in-cross-origin-page.html
2489         https://bugs.webkit.org/show_bug.cgi?id=193740
2490         <rdar://problem/47527267>
2491
2492         Reviewed by Alex Christensen.
2493
2494         The issue was happening when the page is triggering a cross-site navigation while in the middle of parsing. This would cause us to
2495         start a new provisional load in a new process before the previous process sends the DidFinishLoadForFrame() IPC to the UIProcess.
2496         Getting such IPC after a provisional load has started would mess up our state machine and trip assertions.
2497
2498         This patch restores non-PSON behavior which is that the previous load in the old process now gets stopped so that no DidFinishLoadForFrame()
2499         / DidFailLoadForFrame() gets sent. To achieve this behavior, I introduced a new "StopAllLoads" PolicyAction that we now send the old
2500         process when the load is continuing in a new process, instead of sending it "Ignore".
2501
2502         * NetworkProcess/NetworkDataTaskBlob.cpp:
2503         (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse):
2504         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2505         (toNSURLSessionResponseDisposition):
2506         * UIProcess/WebPageProxy.cpp:
2507         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
2508
2509 2019-02-01  Jer Noble  <jer.noble@apple.com>
2510
2511         Unreviewed build fix; Respect the 'condition:' field in the WebPreferences.yaml when generating
2512         WebPreferencesStoreDefaultsMap.cpp.
2513
2514         * page/SettingsBase.h:
2515
2516 2019-02-01  Antoine Quint  <graouts@apple.com>
2517
2518         Dispatch pointercancel events when content is panned or zoomed on iOS
2519         https://bugs.webkit.org/show_bug.cgi?id=193962
2520         <rdar://problem/47629134>
2521
2522         Reviewed by Dean Jackson.
2523
2524         When a user-agent-provided interaction, such as panning or zooming on iOS, uses a set of touches, we should dispatch a pointercancel
2525         event for the pointer ids of the touches involved. To facilitate this, we add a new method on WKContentView to cancel all the pointers
2526         matching active touches for a provided UIGestureRecognizer through an async IPC call into the Web process using the new method
2527         PointerCaptureController::cancelPointer().
2528
2529         * Platform/spi/ios/UIKitSPI.h: Add the necessary forward declaration for a necessary UIKit SPI allowing us to get the set of last-seen
2530         UITouches by the identifier generated for the matching WebKit touch.
2531         * UIProcess/API/Cocoa/WKWebView.mm:
2532         (-[WKWebView scrollViewWillBeginZooming:withView:]): Dispatch touchcancel events for all pointers involved in a pinch gesture on the
2533         top-level UIScrollView.
2534         (-[WKWebView _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]): Dispatch
2535         touchcancel events for all pointers involved in a pan gesture on the top-level UIScrollView. We can infer this by looking at whether the
2536         adjusted content offset, after accounting for the permitted touch actions, is different from the original content offset.
2537         * UIProcess/PageClient.h: Expose a new virtual cancelPointersForGestureRecognizer() method which will allow the iOS implementation to
2538         forward the call to WKContentViewInteraction.
2539         (WebKit::PageClient::cancelPointersForGestureRecognizer):
2540         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h: Expose the WebPageProxy such that we may access it to cancel pointers for
2541         a given gesture recognizer from within ScrollingTreeScrollingNodeDelegateIOS.
2542         (WebKit::RemoteScrollingCoordinatorProxy::webPageProxy const):
2543         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
2544         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
2545         (-[WKScrollingNodeScrollViewDelegate _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]):
2546         Dispatch touchcancel events for all pointers involved in a pan gesture on a nested UIScrollView. We can infer this by looking at
2547         whether the adjusted content offset, after accounting for the permitted touch actions, is different from the original content offset.
2548         (-[WKScrollingNodeScrollViewDelegate scrollViewWillBeginZooming:withView:]): Dispatch touchcancel events for all pointers involved in a
2549         pinch gesture on a nested UIScrollView.
2550         (-[WKScrollingNodeScrollViewDelegate cancelPointersForGestureRecognizer:]):
2551         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::cancelPointersForGestureRecognizer):
2552         * UIProcess/WebPageProxy.cpp:
2553         (WebKit::WebPageProxy::cancelPointer):
2554         * UIProcess/WebPageProxy.h:
2555         * UIProcess/ios/PageClientImplIOS.h:
2556         * UIProcess/ios/PageClientImplIOS.mm:
2557         (WebKit::PageClientImpl::cancelPointersForGestureRecognizer):
2558         * UIProcess/ios/WKContentViewInteraction.h:
2559         * UIProcess/ios/WKContentViewInteraction.mm:
2560         (-[WKContentView cancelPointersForGestureRecognizer:]): Obtain all active UITouch objects for the view and dispatch a pointercancel event,
2561         through the WebPageProxy, for all touches associated with the provided gesture recognizer.
2562         * WebProcess/WebPage/WebPage.cpp:
2563         (WebKit::WebPage::cancelPointer):
2564         * WebProcess/WebPage/WebPage.h:
2565         * WebProcess/WebPage/WebPage.messages.in:
2566
2567 2019-02-01  Jer Noble  <jer.noble@apple.com>
2568
2569         Make the WebKit default for media source based on the WebCore default.
2570         https://bugs.webkit.org/show_bug.cgi?id=194172
2571
2572         Reviewed by Eric Carlson.
2573
2574         * Shared/WebPreferences.yaml:
2575         * UIProcess/API/Cocoa/WKPreferences.mm:
2576         (-[WKPreferences _setMediaSourceEnabled:]):
2577         (-[WKPreferences _mediaSourceEnabled]):
2578         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2579
2580 2019-02-01  Simon Fraser  <simon.fraser@apple.com>
2581
2582         Force settings.acceleratedCompositingEnabled() to true for WebKit
2583         https://bugs.webkit.org/show_bug.cgi?id=194166
2584         rdar://problem/47694328
2585
2586         Reviewed by Tim Horton.
2587
2588         WebKit relies on accelerated compositing for its drawing areas to function correctly,
2589         and sometimes clients (*cough* Safari *cough*) have bugs where they clobber the settings,
2590         so force this setting to be always on (and release log if this happens).
2591
2592         * WebProcess/WebPage/WebPage.cpp:
2593         (WebKit::WebPage::updatePreferences):
2594
2595 2019-02-01  Antti Koivisto  <antti@apple.com>
2596
2597         Don't use base layer() as the scroll layer in scrolling tree.
2598         https://bugs.webkit.org/show_bug.cgi?id=194160
2599
2600         Reviewed by Simon Fraser.
2601
2602         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
2603         (ArgumentCoder<ScrollingStateNode>::encode):
2604         (ArgumentCoder<ScrollingStateNode>::decode):
2605         (ArgumentCoder<ScrollingStateScrollingNode>::encode):
2606         (ArgumentCoder<ScrollingStateScrollingNode>::decode):
2607         (WebKit::dump):
2608         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
2609         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
2610         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
2611         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
2612         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
2613         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
2614         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
2615         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateBeforeChildren):
2616         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
2617         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateBeforeChildren):
2618         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):
2619
2620 2019-02-01  Michael Catanzaro  <mcatanzaro@igalia.com>
2621
2622         [SOUP] Improve use of SoupCookiePersistentStorageType
2623         https://bugs.webkit.org/show_bug.cgi?id=194103
2624
2625         Reviewed by Carlos Garcia Campos.
2626
2627         Turn it into an enum class, and stop casting it to and from uint32_t.
2628
2629         * NetworkProcess/Cookies/WebCookieManager.h:
2630         * NetworkProcess/Cookies/WebCookieManager.messages.in:
2631         * NetworkProcess/Cookies/soup/WebCookieManagerSoup.cpp:
2632         (WebKit::WebCookieManager::setCookiePersistentStorage):
2633         * NetworkProcess/NetworkSessionCreationParameters.cpp:
2634         (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
2635         (WebKit::NetworkSessionCreationParameters::decode):
2636         * NetworkProcess/NetworkSessionCreationParameters.h:
2637         * Shared/soup/SoupCookiePersistentStorageType.h:
2638         (): Deleted.
2639         * UIProcess/API/glib/WebKitCookieManager.cpp:
2640         * UIProcess/WebCookieManagerProxy.h:
2641         * UIProcess/soup/WebCookieManagerProxySoup.cpp:
2642         (WebKit::WebCookieManagerProxy::setCookiePersistentStorage):
2643         (WebKit::WebCookieManagerProxy::getCookiePersistentStorage const):
2644
2645 2019-02-01  Per Arne Vollan  <pvollan@apple.com>
2646
2647         [macOS] Revert parts of r240811, since it causes kernel panics.
2648         https://bugs.webkit.org/show_bug.cgi?id=194061
2649
2650         Unreviewed crash fix.
2651
2652         * WebProcess/com.apple.WebProcess.sb.in:
2653
2654 2019-02-01  Michael Catanzaro  <mcatanzaro@igalia.com>
2655
2656         [SOUP] Improve use of PAL::SessionID in WebKitCookieManager
2657         https://bugs.webkit.org/show_bug.cgi?id=194092
2658
2659         Reviewed by Carlos Garcia Campos.
2660
2661         Always get it from the data store instead of assuming the default session ID, and add a
2662         helper function for this.
2663
2664         * UIProcess/API/glib/WebKitCookieManager.cpp:
2665         (_WebKitCookieManagerPrivate::sessionID const):
2666         (_WebKitCookieManagerPrivate::~_WebKitCookieManagerPrivate):
2667         (webkitCookieManagerCreate):
2668         (webkit_cookie_manager_set_persistent_storage):
2669         (webkit_cookie_manager_set_accept_policy):
2670         (webkit_cookie_manager_get_accept_policy):
2671         (webkit_cookie_manager_add_cookie):
2672         (webkit_cookie_manager_get_cookies):
2673         (webkit_cookie_manager_delete_cookie):
2674
2675 2019-01-31  Takashi Komori  <Takashi.Komori@sony.com>
2676
2677         [Curl] Remove unnecessary member from NetworkStorageSession.
2678         https://bugs.webkit.org/show_bug.cgi?id=194137
2679
2680         Reviewed by Don Olmstead.
2681
2682         * NetworkProcess/curl/NetworkProcessCurl.cpp:
2683         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
2684
2685 2019-01-31  Jiewen Tan  <jiewen_tan@apple.com>
2686
2687         Unreviewed, build fix after r240805
2688
2689         This patch reverts the BlockPtr change since it breaks iOS builds.
2690
2691         * UIProcess/Cocoa/NavigationState.mm:
2692         (WebKit::tryInterceptNavigation):
2693
2694 2019-01-31  Chris Dumez  <cdumez@apple.com>
2695
2696         Page zoom level is lost after a process swap or a crash
2697         https://bugs.webkit.org/show_bug.cgi?id=194105
2698         <rdar://problem/47610781>
2699
2700         Reviewed by Alex Christensen.
2701
2702         Previously, when the client would call setPageAndTextZoomFactors() on the WebPageProxy,
2703         we would update the WebPageProxy's corresponding data members and send an IPC to the
2704         WebProcess to apply the zoom factors.
2705
2706         The issue is that on process crash or process-swap, we never communicate those zoom factors
2707         to the new WebProcess. Even if the client were to call setPageAndTextZoomFactors() with
2708         the same factors again, it would be a no-op since the WebPageProxy's data members already
2709         reflect the expected values.
2710
2711         To address the issue, pass both the page zoom and the text zoom factors to the WebProcess
2712         via WebPageCreationParameters. This way, there is no need to send an extra IPC and we're
2713         sure the WebPageProxy's factors are properly applied to the WebPage on WebContent process
2714         side upon creation (whether after a crash or a process swap).
2715
2716         * Shared/WebPageCreationParameters.cpp:
2717         (WebKit::WebPageCreationParameters::encode const):
2718         (WebKit::WebPageCreationParameters::decode):
2719         * Shared/WebPageCreationParameters.h:
2720         * UIProcess/WebPageProxy.cpp:
2721         (WebKit::WebPageProxy::creationParameters):
2722         * WebProcess/WebPage/WebPage.cpp:
2723
2724 2019-01-31  Per Arne Vollan  <pvollan@apple.com>
2725
2726         [macOS] Disable permissive call logging in sandbox
2727         https://bugs.webkit.org/show_bug.cgi?id=194061
2728
2729         Reviewed by Alexey Proskuryakov.
2730
2731         Strict call filtering should be reenabled.
2732
2733         * WebProcess/com.apple.WebProcess.sb.in:
2734
2735 2019-01-31  Per Arne Vollan  <pvollan@apple.com>
2736
2737         [macOS] Crash when control-clicking or copying text rendered with a web font
2738         https://bugs.webkit.org/show_bug.cgi?id=193913
2739         <rdar://problem/47541039>
2740
2741         Reviewed by Brent Fulgham.
2742
2743         On older versions of macOS, allowing mach lookup to com.apple.FontObjectsServer is needed.
2744
2745         * WebProcess/com.apple.WebProcess.sb.in:
2746
2747 2019-01-31  Benjamin Poulain  <benjamin@webkit.org>
2748
2749         Remove WKPageIsWebProcessResponsive
2750         https://bugs.webkit.org/show_bug.cgi?id=194096
2751
2752         Reviewed by Alex Christensen.
2753
2754         It is not used by any client.
2755
2756         It is also bad API. It is better to let WebKit track
2757         responsiveness and tell the client with processDidBecomeResponsive.
2758
2759         * UIProcess/API/C/WKPage.cpp:
2760         (WKPageIsWebProcessResponsive): Deleted.
2761         * UIProcess/API/C/WKPagePrivate.h:
2762         * UIProcess/WebPageProxy.cpp:
2763         (WebKit::WebPageProxy::isWebProcessResponsive): Deleted.
2764         * UIProcess/WebPageProxy.h:
2765
2766 2019-01-31  Alex Christensen  <achristensen@webkit.org>
2767
2768         Revert r238819 which is unneeded and caused a performance regression.
2769         https://bugs.webkit.org/show_bug.cgi?id=192272
2770         <rdar://problem/46664625>
2771
2772         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
2773         (API::InjectedBundle::PageLoaderClient::didStartProvisionalLoadForFrame):
2774         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
2775         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
2776         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2777         (PageLoaderClient::didStartProvisionalLoadForFrame):
2778         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
2779         (WebKit::InjectedBundlePageLoaderClient::didStartProvisionalLoadForFrame):
2780         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
2781         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2782         (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
2783         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2784
2785 2019-01-31  Jiewen Tan  <jiewen_tan@apple.com>
2786
2787         Formalize WebKitAdditions mechanism of LoadOptimizer
2788         https://bugs.webkit.org/show_bug.cgi?id=193886
2789         <rdar://problem/47696809>
2790
2791         Reviewed by Brent Fulgham.
2792
2793         This patch does the following few things:
2794         1) formalizes WebKitAdditions mechanism of LoadOptimizer;
2795         2) modernizes AppLinks code in tryInterceptNavigation to use BlockPtr;
2796         3) lets AppLinks have higher precedence than LoadOptimizer.
2797
2798         * SourcesCocoa.txt:
2799         * UIProcess/Cocoa/LoadOptimizer.h: Removed.
2800         * UIProcess/Cocoa/LoadOptimizer.mm: Removed.
2801         * UIProcess/Cocoa/NavigationState.mm:
2802         (WebKit::tryOptimizingLoad):
2803         (WebKit::tryInterceptNavigation):
2804         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2805         (WebKit::WebsiteDataStore::WebsiteDataStore):
2806         * UIProcess/WebsiteData/WebsiteDataStore.h:
2807         (WebKit::WebsiteDataStore::loadOptimizer): Deleted.
2808         * WebKit.xcodeproj/project.pbxproj:
2809
2810 2019-01-31  Chris Dumez  <cdumez@apple.com>
2811
2812         Regression(PSON) Crash under WebProcessProxy::canTerminateChildProcess()
2813         https://bugs.webkit.org/show_bug.cgi?id=194094
2814         <rdar://problem/47580753>
2815
2816         Reviewed by Ryosuke Niwa.
2817
2818         If a SuspendedPageProxy gets destroyed while a WebPageProxy is waiting for its to finish to suspend,
2819         call the "failure to suspend" completion handler asynchronously instead of synchronouly to make sure
2820         the completion handler cannot try and use the suspended page proxy while it is being destroyed.
2821
2822         * UIProcess/SuspendedPageProxy.cpp:
2823         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
2824
2825 2019-01-31  Timothy Hatcher  <timothy@apple.com>
2826
2827         Fix LSAppLink deprecation warnings.
2828         https://bugs.webkit.org/show_bug.cgi?id=194097
2829
2830         Unreviewed build fix.
2831
2832         * UIProcess/ios/WKActionSheetAssistant.mm:
2833         (-[WKActionSheetAssistant _appendOpenActionsForURL:actions:elementInfo:]):
2834
2835 2019-01-30  Simon Fraser  <simon.fraser@apple.com>
2836
2837         [Mac] Implement basic hit testing in the scrolling tree
2838         https://bugs.webkit.org/show_bug.cgi?id=172917
2839         <rdar://problem/34215516>
2840
2841         Reviewed by Antti Koivisto.
2842
2843         Changed return types, "using namespace WebCore" in ScrollingTreeFrameScrollingNodeRemoteMac.cpp.
2844
2845         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
2846         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
2847         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
2848         * UIProcess/RemoteLayerTree/mac/ScrollerPairMac.h:
2849         * UIProcess/RemoteLayerTree/mac/ScrollerPairMac.mm:
2850         (WebKit::ScrollerPairMac::handleWheelEvent):
2851         (WebKit::ScrollerPairMac::handleMouseEvent):
2852         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp:
2853         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::handleWheelEvent):
2854         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::handleMouseEvent):
2855         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.h:
2856
2857 2019-01-31  Michael Catanzaro  <mcatanzaro@igalia.com>
2858
2859         [SOUP] Move cookiePersistentStoragePath and cookiePersistentStorageType from NetworkProcess to NetworkSession
2860         https://bugs.webkit.org/show_bug.cgi?id=194075
2861
2862         Reviewed by Alex Christensen.
2863
2864         Move cookiePersistentStoragePath and cookiePersistentStorageType from NetworkProcess to
2865         NetworkSession to reduce globals. This removes two of the six soup-specific variables in
2866         NetworkProcessCreationParameters
2867
2868         * NetworkProcess/Cookies/WebCookieManager.h:
2869         * NetworkProcess/Cookies/WebCookieManager.messages.in:
2870         * NetworkProcess/Cookies/soup/WebCookieManagerSoup.cpp:
2871         (WebKit::WebCookieManager::setCookiePersistentStorage):
2872         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2873         (WebKit::NetworkProcessCreationParameters::encode const):
2874         (WebKit::NetworkProcessCreationParameters::decode):
2875         * NetworkProcess/NetworkProcessCreationParameters.h:
2876         * NetworkProcess/NetworkSessionCreationParameters.cpp:
2877         (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
2878         (WebKit::NetworkSessionCreationParameters::encode const):
2879         (WebKit::NetworkSessionCreationParameters::decode):
2880         * NetworkProcess/NetworkSessionCreationParameters.h:
2881         * NetworkProcess/soup/NetworkProcessSoup.cpp:
2882         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
2883         * NetworkProcess/soup/NetworkSessionSoup.cpp:
2884         (WebKit::NetworkSessionSoup::NetworkSessionSoup):
2885         * SourcesGTK.txt:
2886         * SourcesWPE.txt:
2887         * UIProcess/API/glib/WebKitCookieManager.cpp:
2888         (webkit_cookie_manager_set_persistent_storage):
2889         * UIProcess/WebCookieManagerProxy.cpp:
2890         (WebKit::WebCookieManagerProxy::WebCookieManagerProxy):
2891         * UIProcess/WebCookieManagerProxy.h:
2892         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2893         (WebKit::WebsiteDataStore::parameters):
2894         * UIProcess/WebsiteData/WebsiteDataStore.h:
2895         * UIProcess/WebsiteData/curl/WebsiteDataStoreCurl.cpp:
2896         (WebKit::WebsiteDataStore::platformSetNetworkParameters):
2897         (WebKit::WebsiteDataStore::platformSetParameters): Deleted.
2898         * UIProcess/soup/WebCookieManagerProxySoup.cpp:
2899         (WebKit::WebCookieManagerProxy::setCookiePersistentStorage):
2900         (WebKit::WebCookieManagerProxy::getCookiePersistentStorage const):
2901         * UIProcess/soup/WebProcessPoolSoup.cpp:
2902         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2903
2904 2019-01-31  Ryosuke Niwa  <rniwa@webkit.org>
2905
2906         iOS: Crash in InteractiveUpdateHandler set by ViewGestureController::beginSwipeGesture
2907         https://bugs.webkit.org/show_bug.cgi?id=194083
2908
2909         Reviewed by Tim Horton.
2910
2911         We think this crash is a regression from r236966. Prior to r236966, we could only called
2912         removeSwipeSnapshot() only when m_provisionalOrSameDocumentLoadCallback was set but now
2913         we can call it either when m_snapshotRemovalTracker::start was called, or it had been reset.
2914         This can result in m_webPageProxyForBackForwardListForCurrentSwipe getting cleared before
2915         InteractiveUpdateHandler is called by UIGestureRecognizer, resulting in the crash.
2916
2917         This patch tries to restore the behavior prior to r236966 by only invoking removeSwipeSnapshot()
2918         when SnapshotRemovalTracker has a valid removal callback set.
2919
2920         Unfortunately no new tests since there is no reproducible test case, and neither API tests
2921         nor layout tests seem to have the capability to trigger swipe gestures via UIGestureRecognizer,
2922         which is required for this crash to occur. Notably, back-forward swipe tests I enabled in
2923         r240765 bypass UIKit and emulates the action instead.
2924
2925         * UIProcess/Cocoa/ViewGestureController.cpp:
2926         (WebKit::ViewGestureController::didReachMainFrameLoadTerminalState):
2927         * UIProcess/Cocoa/ViewGestureController.h:
2928         (WebKit::ViewGestureController::SnapshotRemovalTracker::hasRemovalCallback const):
2929
2930 2019-01-30  Benjamin Poulain  <benjamin@webkit.org>
2931
2932         <rdar://problem/47570443> Responsiveness timers are too expensive for frequent events
2933         https://bugs.webkit.org/show_bug.cgi?id=194003
2934
2935         Reviewed by Geoffrey Garen.
2936
2937         The problem here is specific to wheel events.
2938
2939         For every wheel event, we start a responsiveness timer and send
2940         a ping to the WebProcess. When the WebProcess respond, we stop the timer.
2941
2942         The cost of setting up the timers adds up since we get many events.
2943
2944         The first step to improve the situation was to switch ResponsivenessTimer
2945         to WebCore::Timer. Since WebCore::Timer reuse the same CFRunLoopTimerRef,
2946         we save the allocation/deallocation, insertion in the event loop, etc.
2947
2948         Using WebCore::Timer saves some instructions but we were still hitting
2949         the kernel at 120hz to set up then kill each timer.
2950         The second improvement of the patch is to avoid that by not killing the timer
2951         when we hear back from the WebProcess.
2952
2953         Instead of killing the timer, we let it run and ignore the result.
2954         When the next event comes, we reschedule the existing timer.
2955         This brings down the timers to 60Hz, the same rate as the events.
2956
2957         The very last event does time out. In that case, we have a bad idle wake up:
2958         we wake up a sleeping CPU do do nothing.
2959         In the case of wheel events, this is fine since we saved a bunch of CPU already.
2960         For all the other cases, I kept the normal operating mode to avoid the idle wake.
2961
2962         * UIProcess/ResponsivenessTimer.cpp:
2963         (WebKit::ResponsivenessTimer::ResponsivenessTimer):
2964         (WebKit::ResponsivenessTimer::invalidate):
2965         (WebKit::ResponsivenessTimer::timerFired):
2966         (WebKit::ResponsivenessTimer::start):
2967         (WebKit::ResponsivenessTimer::startWithLazyStop):
2968         (WebKit::ResponsivenessTimer::stop):
2969         (WebKit::ResponsivenessTimer::processTerminated):
2970         (WebKit::ResponsivenessTimer::~ResponsivenessTimer): Deleted.
2971         * UIProcess/ResponsivenessTimer.h:
2972         * UIProcess/WebPageProxy.cpp:
2973         (WebKit::WebPageProxy::sendWheelEvent):
2974         * UIProcess/WebProcessProxy.cpp:
2975         (WebKit::WebProcessProxy::isResponsiveWithLazyStop):
2976         * UIProcess/WebProcessProxy.h:
2977
2978 2019-01-30  Daniel Bates  <dabates@apple.com>
2979
2980         [iOS] REGRESSION (r238635): Text area fails to re-focus after dismissal of keyboard on support.apple.com
2981         https://bugs.webkit.org/show_bug.cgi?id=193987
2982         <rdar://problem/47230785>
2983
2984         Reviewed by Tim Horton.
2985
2986         It is unnecessary to relinquish first responder status when a user explicitly dismissing
2987         the keyboard. Moreover, doing so prevents key commands from being intercepted when a
2988         hardware keyboard is subsequently attached.
2989         
2990         Following r238635 a page becomes focused (accepting of keyboard input) and defocused
2991         when the WKContentView becomes first responder and resigns first responder, respectively.
2992         When a user explicitly dismisses the keyboard by tapping Done (iPhone) or the hide keyboard
2993         button (iPad) then UIKit tells WKContentView to resign its first responder status only
2994         to make its superview, WKWebView, first responder. When a person subsequently taps on the
2995         page again, the WKContentView requests to become the first responder. However changes to
2996         page focus are not guaranteed to be sent to the WebProcess immediately (WebPageProxy::activityStateDidChange()
2997         will schedule an update). In particular, they are not guaranteed to be sent before the
2998         WebProcess is told about a tap. Therefore, the WebProcess has out-of-date information on
2999         focus state of the page. Instead we should detect when WKWebView is being asked to resign
3000         as a result of the keyboard dismissal and refuse the request, taking care to end the current
3001         editing session, blur the focused element, and dismiss the on-screen keyboard.
3002
3003         * Platform/spi/ios/UIKitSPI.h: Expose some SPI.
3004         * UIProcess/ios/WKContentViewInteraction.h:
3005         * UIProcess/ios/WKContentViewInteraction.mm:
3006         (-[WKContentView setupInteraction]): Register to receive notifications whenever a user
3007         explicitly dismisses the keyboard.
3008         (-[WKContentView resignFirstResponderForWebView]): If we are being asked to resign as a
3009         result of a user explicitly dismissing the keyboard then refuse to resign.
3010         (-[WKContentView _keyboardDidRequestDismissal:]): Update state, if applicable.
3011
3012 2019-01-30  Keith Rollin  <krollin@apple.com>
3013
3014         Add default constructor for NetworkActivityTracker
3015         https://bugs.webkit.org/show_bug.cgi?id=194058
3016         <rdar://problem/47685457>
3017
3018         Reviewed by Chris Dumez.
3019
3020         ResourceNetworkActivityTracker has a default constructor. It also has
3021         a NetworkActivityTracker data member, which does not have a default
3022         constructor. This will cause some compilers to complain -- they can't
3023         default-create a ResourceNetworkActivityTracker because they can't
3024         default-create its data members. Address this by adding a default
3025         constructor for NetworkActivityTracker.
3026
3027         * NetworkProcess/NetworkActivityTracker.h:
3028
3029 2019-01-30  Daniel Steffen  <dsteffen@apple.com>
3030
3031         <rdar://problem/29471922> Safari should switch from the legacy denap SPI to handling vouchers
3032         https://bugs.webkit.org/show_bug.cgi?id=193992
3033
3034         Reviewed by Geoffrey Garen.
3035
3036         The denap SPI is deprecated.
3037         The new way of staying out of AppNap is through a voucher.
3038
3039         * Platform/IPC/mac/ConnectionMac.mm:
3040         (IPC::readFromMachPort):
3041         * Platform/IPC/mac/ImportanceAssertion.h:
3042         (IPC::ImportanceAssertion::ImportanceAssertion):
3043         (IPC::ImportanceAssertion::~ImportanceAssertion):
3044
3045 2019-01-30  Chris Dumez  <cdumez@apple.com>
3046
3047         Fix crashes when trying to ref the CallbackAggregator in NetworkProcess
3048         https://bugs.webkit.org/show_bug.cgi?id=194054
3049
3050         Reviewed by Brent Fulgham.
3051
3052         The callback aggregators should be ThreadSafeRefCounted since they are passed to other threads.
3053
3054         * NetworkProcess/NetworkProcess.cpp:
3055         (WebKit::NetworkProcess::fetchWebsiteData):
3056         (WebKit::NetworkProcess::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
3057         (WebKit::NetworkProcess::topPrivatelyControlledDomainsWithWebsiteData):
3058
3059 2019-01-30  Daniel Bates  <dabates@apple.com>
3060
3061         [iOS] Keyups for non-modifier keys identified as "Dead" when not focused in a content-editable element
3062         https://bugs.webkit.org/show_bug.cgi?id=192824
3063         <rdar://problem/47100332>
3064
3065         Reviewed by Wenson Hsieh.
3066
3067         Use the same code path for key events to editable elements and non-editable elements.
3068
3069         Currently we have different code paths for hardware key events depending on whether the active element
3070         is editable or non-editable. Historically to support dispatching DOM keyboard events for hardware key
3071         presses this differentiation was a necessary workaround for UIKit's event processing precedence of
3072         interpreting key events for system text editing commands and app commands before dispatching unhandled
3073         key events to WebKit. This workaround intercepted raw key UIEvents and manually reconstructed a
3074         WebEvent from it. However there is not enough information in an UIEvent to reconstruct a WebEvent that
3075         is identical to the WebEvent that UIKit would have dispatched. In particular, keyup UIEvents always have
3076         empty modified and unmodified input strings. The UIKit keyboard machinery maintains additional state
3077         that is necessary to manufacture the correct WebEvent corresponding to a UIEvent.
3078
3079         As a side benefit of this change, with the exception of modifier flag changes, both hardware and software
3080         key events use the same code path.
3081
3082         * UIProcess/ios/WKContentViewInteraction.h:
3083         * UIProcess/ios/WKContentViewInteraction.mm:
3084         (-[WKContentView shouldShowAutomaticKeyboardUI]): Extracted code from _requiresKeyboardWhenFirstResponder
3085         (-[WKContentView _disableAutomaticKeyboardUI]): Implement UIKit SPI to prevent showing the keyboard UI
3086         when there is no focused element now that we are no longer intercepting key UIEvents. Formerly the
3087         keyboard UI was disabled as a side effect of not becoming first responder when there was no focused
3088         element (by returning NO in -_requiresKeyboardWhenFirstResponder).
3089         (-[WKContentView _requiresKeyboardWhenFirstResponder]): Always return YES when building with USE(UIKIT_KEYBOARD_ADDITIONS)
3090         so that we always accept key events. Instead of selectively replying to create a keyboard as a means of
3091         hiding the automatic keyboard UI we now implement _disableAutomaticKeyboardUI to selectively hide the
3092         automatic keyboard UI.
3093         (-[WKContentView textInputTraits]): Do not update traits when the keyboard is going to be dismissed
3094         now that we require a keyboard when first responder even if the focused element is non-editable.
3095         (-[WKContentView _didHandleKeyEvent:eventWasHandled:]): Skip logic for re-sending UIEvents to UIKit
3096         as UIKit now processes the event first. This logic was necessary in order to finally allow UIKit
3097         its chance to interpret the UIEvent, we intercepted, for app key commands.
3098         (-[WKContentView _elementDidBlur]): Call [self _endEditing] so that we dismiss any open form controls
3099         (e.g. a <select> popover menu). Currently this happens either by -_requiresKeyboardWhenFirstResponder
3100         responding NO when switching to another field or pressing Tab or Shift + Tab key command, which we will
3101         no longer use when building with USE(UIKIT_KEYBOARD_ADDITIONS) once I land <https://bugs.webkit.org/show_bug.cgi?id=193048>.
3102         * UIProcess/ios/forms/WKFormSelectPopover.mm:
3103         (-[WKSelectPopover initWithView:hasGroups:]): Do not assign ourself as the keyboard delegate. Otherwise,
3104         type ahead and tab cycling will not work. Currently type ahead and tab cycling work by using the non-
3105         editable code path via -_handleKeyUIEvent. Now that we no longer differentiate between key events for
3106         editable and non-editable elements we need to ensure that the WKContentView is the keyboard delegate
3107         when the popover is presented.
3108
3109 2019-01-30  Per Arne Vollan  <pvollan@apple.com>
3110
3111         [macOS] Sandbox fails to compile on 10.12
3112         https://bugs.webkit.org/show_bug.cgi?id=194035
3113         <rdar://problem/47651260>
3114
3115         Reviewed by Brent Fulgham.
3116
3117         This was caused by the commit <https://trac.webkit.org/changeset/239994>, which is only valid for
3118         10.14 and later.
3119
3120         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
3121         * WebProcess/com.apple.WebProcess.sb.in:
3122
3123 2019-01-29  Conrad Shultz  <conrad_shultz@apple.com>
3124
3125         Ensure image picker sourceType is set before cameraDevice
3126         https://bugs.webkit.org/show_bug.cgi?id=193998
3127
3128         Reviewed by Beth Dakin.
3129
3130         * UIProcess/ios/forms/WKFileUploadPanel.mm:
3131         (-[WKFileUploadPanel _showPhotoPickerWithSourceType:]):
3132
3133 2019-01-30  Chris Dumez  <cdumez@apple.com>
3134
3135         Regression(PSON) Load hang can occur on history navigation
3136         https://bugs.webkit.org/show_bug.cgi?id=194030
3137         <rdar://problem/47656939>
3138
3139         Reviewed by Antti Koivisto.
3140
3141         We do not support having more than one WebPage in a WebProcess with the same page ID. As a result,
3142         if we decide to reuse an existing process on process-swap, we need to make sure that we either use
3143         its suspended page (when possible, meaning that it is for the right HistoryItem / page) or we need
3144         make sure we drop the existing suspended page for this process / pagePID combination, so that the
3145         WebPage on WebProcess side gets closed before we attempt to do the new load.
3146
3147         We were doing this correctly in 2 places in WebProcessPool::processForNavigationInternal() but failed
3148         to do so in a third place, when doing back to a HistoryItem which does not have a SuspendedPage but
3149         whose process is still alive (presumably because it is kept alive by another suspended page). This
3150         patch fixes this third place to remove any suspended page in the process for the current page before
3151         reusing the process. An assertion was also added to the call site in
3152         WebPageProxy::receivedNavigationPolicyDecision() to make sure we catch this more easily in the
3153         future.
3154
3155         * UIProcess/WebPageProxy.cpp:
3156         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
3157         * UIProcess/WebProcessPool.cpp:
3158         (WebKit::WebProcessPool::processForNavigationInternal):
3159         (WebKit::WebProcessPool::removeAllSuspendedPagesForPage):
3160         (WebKit::WebProcessPool::hasSuspendedPageFor const):
3161         * UIProcess/WebProcessPool.h:
3162
3163 2019-01-30  Carlos Garcia Campos  <cgarcia@igalia.com>
3164
3165         [GTK][Wayland] REGRESSION(r240712): Clear the GL context if it's the current one on dispose
3166         https://bugs.webkit.org/show_bug.cgi?id=194024
3167
3168         Reviewed by Michael Catanzaro.
3169
3170         Fixes a crash in gdk_gl_context_dispose().
3171
3172         * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
3173         (WebKit::AcceleratedBackingStoreWayland::~AcceleratedBackingStoreWayland):
3174
3175 2019-01-30  Antti Koivisto  <antti@apple.com>
3176
3177         Crash in WebKit::RemoteLayerTreePropertyApplier::updateChildren
3178         https://bugs.webkit.org/show_bug.cgi?id=193897
3179         <rdar://problem/47427750>
3180
3181         Reviewed by Simon Fraser.
3182
3183         There has been some null pointer crashes where we fail to find a remote layer tree node that matches
3184         the transaction properties.
3185
3186         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
3187         (WebKit::RemoteLayerTreePropertyApplier::updateChildren):
3188
3189         Null check the nodes.
3190
3191 2019-01-30  Simon Fraser  <simon.fraser@apple.com>
3192
3193         Add some basic geometry information to the scrolling tree
3194         https://bugs.webkit.org/show_bug.cgi?id=194002
3195
3196         Reviewed by Antti Koivisto.
3197
3198         Add a comment explaining why we don't need to encode/decode ParentRelativeScrollableRect.
3199
3200         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
3201         (ArgumentCoder<ScrollingStateFrameHostingNode>::encode):
3202
3203 2019-01-30  Carlos Garcia Campos  <cgarcia@igalia.com>
3204
3205         [GTK] gdk_cairo_draw_from_gl() in AcceleratedBackingStoreWayland fails in GtkInspector's magnifier
3206         https://bugs.webkit.org/show_bug.cgi?id=193903
3207
3208         Reviewed by Michael Catanzaro.
3209
3210         The problem is that the GL context used by WaylandCompositor can't share resources with the one used by GTK+
3211         when painting with gdk_cairo_draw_from_gl(). Accelerated compositing in Wayland works only because
3212         WaylandCompositor makes the context current only once on initialization. So, when we render the first frame on
3213         accelerated compositing mode, GTK+ is rendering in non-GL mode, and switches to the GL mode when
3214         gdk_cairo_draw_from_gl() is called. Since GTK+ didn't have a GL context yet, the first frame is always rendered
3215         by GTK+ using the software fallback (glReadPixels). The thing is that the first time gdk_cairo_draw_from_gl() is
3216         called, GTK+ creates a GL context for painting that is made current, and it will remain the current one
3217         forever. The first frame fails to render with "GL_INVALID_OPERATION in glBindTexture(non-gen name)" because the
3218         texture created in WaylandCompositor GL context can't be accessed from GTK+ GL context. The following frames are
3219         handled with the GTK+ GL context. I would say this works by casuality and it could be the cause of other
3220         accelerated compositing issues in Wayland.
3221
3222         We need to create our own GdkGLContext for the WebView, and use that in the WaylandCompositor. When the
3223         GdkGLContext is created, the GTK+ GL context for painting is used as a shared context, ensuring that resources
3224         created in the new context will be accessible from the painting one.
3225
3226         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3227         (webkitWebViewBaseMakeGLContextCurrent): Call AcceleratedBackingStore::makeContextCurrent().
3228         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
3229         * UIProcess/WebPageProxy.h:
3230         * UIProcess/gtk/AcceleratedBackingStore.h:
3231         (WebKit::AcceleratedBackingStore::makeContextCurrent): New virtual method only implemented by Wayland backend.
3232         * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
3233         (WebKit::AcceleratedBackingStoreWayland::tryEnsureGLContext): Try to create a GL context with
3234         gdk_window_create_gl_context(), falling back to a WebCore::GLContext if it fails or GTK+ version is not new enough.
3235         (WebKit::AcceleratedBackingStoreWayland::makeContextCurrent): Make the GL context current.
3236         (WebKit::AcceleratedBackingStoreWayland::paint): Check if we have a GdkGLContext before trying to use gdk_cairo_draw_from_gl().
3237         (WebKit::AcceleratedBackingStoreWayland::canGdkUseGL const): Deleted.
3238         * UIProcess/gtk/AcceleratedBackingStoreWayland.h:
3239         * UIProcess/gtk/WaylandCompositor.cpp:
3240         (WebKit::WaylandCompositor::Surface::Surface): Move the texture creation to setWebPage(), since we need the
3241         WebView GL context.
3242         (WebKit::WaylandCompositor::Surface::~Surface): Move the code to destroy GL resources to setWebPage().
3243         (WebKit::WaylandCompositor::Surface::setWebPage): Create the texture when a new page is set and destroy GL
3244         resources when unset.
3245         (WebKit::WaylandCompositor::Surface::prepareTextureForPainting): Make WebView GL context current.
3246         (WebKit::WaylandCompositor::Surface::commit): Ditto.
3247         (WebKit::WaylandCompositor::initializeEGL): Use a temporary GLContext.
3248         * UIProcess/gtk/WaylandCompositor.h:
3249         * UIProcess/gtk/WebPageProxyGtk.cpp:
3250         (WebKit::WebPageProxy::makeGLContextCurrent): Call webkitWebViewBaseMakeGLContextCurrent().
3251
3252 2019-01-29  Ryosuke Niwa  <rniwa@webkit.org>
3253
3254         iOS: Nullptr crash in WebPage::getPositionInformation dereferencing an input element for data list
3255         https://bugs.webkit.org/show_bug.cgi?id=193996
3256
3257         Reviewed by Wenson Hsieh.
3258
3259         Added a missing nullptr check.
3260
3261         * WebProcess/WebPage/ios/WebPageIOS.mm:
3262         (WebKit::WebPage::getPositionInformation):
3263
3264 2019-01-29  Simon Fraser  <simon.fraser@apple.com>
3265
3266         Add nodes to the scrolling tree in z-index order.
3267         https://bugs.webkit.org/show_bug.cgi?id=192529
3268         <rdar://problem/47402708>
3269
3270         Reviewed by Dean Jackson.
3271
3272         FrameHosting nodes have layers, so need to update them.
3273
3274         * Platform/Logging.cpp:
3275         (WebKit::initializeLogChannelsIfNecessary):
3276         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
3277         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
3278
3279 2019-01-29  Alex Christensen  <achristensen@webkit.org>
3280
3281         Change NetworkConnectionToWebProcess* to NetworkConnectionToWebProcess& where possible
3282         https://bugs.webkit.org/show_bug.cgi?id=193974
3283
3284         Reviewed by Tim Horton.
3285
3286         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
3287         (WebKit::NetworkBlobRegistry::registerFileBlobURL):
3288         (WebKit::NetworkBlobRegistry::registerBlobURL):
3289         (WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked):
3290         (WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
3291         (WebKit::NetworkBlobRegistry::unregisterBlobURL):
3292         (WebKit::NetworkBlobRegistry::blobSize):
3293         (WebKit::NetworkBlobRegistry::connectionToWebProcessDidClose):
3294         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
3295         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3296         (WebKit::NetworkConnectionToWebProcess::didClose):
3297         (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
3298         (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
3299         (WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL):
3300         (WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
3301         (WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
3302         (WebKit::NetworkConnectionToWebProcess::unregisterBlobURL):
3303         (WebKit::NetworkConnectionToWebProcess::blobSize):
3304         * NetworkProcess/NetworkProcess.cpp:
3305         (WebKit::NetworkProcess::removeNetworkConnectionToWebProcess):
3306         * NetworkProcess/NetworkProcess.h:
3307
3308 2019-01-29  Youenn Fablet  <youenn@apple.com>
3309
3310         Adopt new SPI to evaluate server certificate trust
3311         https://bugs.webkit.org/show_bug.cgi?id=193355
3312
3313         Reviewed by Alex Christensen.
3314
3315         Use new SPI provided in NSURLSession to evaluate server certificates.
3316         If successful, let loading proceed as usual.
3317         Otherwise, go to the UIProcess to ask for a decision on continuing the load or not.
3318
3319         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
3320         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3321         (canNSURLSessionTrustEvaluate):
3322         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
3323         (WebKit::NetworkSessionCocoa::continueDidReceiveChallenge):
3324
3325 2019-01-29  Tim Horton  <timothy_horton@apple.com>
3326
3327         Fix the build
3328
3329         * UIProcess/ios/WKDrawingCoordinator.h:
3330         * UIProcess/ios/WKDrawingCoordinator.mm:
3331         * UIProcess/ios/WKDrawingView.mm:
3332
3333 2019-01-29  Alex Christensen  <achristensen@webkit.org>
3334
3335         Remove unused NetworkProcessProxy::writeBlobToFilePath
3336         https://bugs.webkit.org/show_bug.cgi?id=193990
3337
3338         Reviewed by Wenson Hsieh.
3339
3340         This code was only used in code that was introduced in r235202
3341         but that has since been refactored to not use blobs.  Its tests still pass.
3342         This removes the only UIProcess-controlled code that uses NetworkBlobRegistry::singleton.
3343
3344         * NetworkProcess/NetworkProcess.cpp:
3345         (WebKit::NetworkProcess::writeBlobToFilePath): Deleted.
3346         * NetworkProcess/NetworkProcess.h:
3347         * NetworkProcess/NetworkProcess.messages.in:
3348         * UIProcess/Cocoa/WebViewImpl.mm:
3349         (WebKit::WebViewImpl::writeToURLForFilePromiseProvider):
3350         * UIProcess/Network/NetworkProcessProxy.cpp:
3351         (WebKit::NetworkProcessProxy::writeBlobToFilePath): Deleted.
3352         * UIProcess/Network/NetworkProcessProxy.h:
3353         * UIProcess/WebPageProxy.cpp:
3354         (WebKit::WebPageProxy::writeBlobToFilePath): Deleted.
3355         * UIProcess/WebPageProxy.h:
3356
3357 2019-01-29  Devin Rousso  <drousso@apple.com>
3358
3359         Web Inspector: expose a way of determining if a detached frontend is for a remote target
3360         https://bugs.webkit.org/show_bug.cgi?id=193951
3361         <rdar://problem/47621366>
3362
3363         Reviewed by Joseph Pecoraro.
3364
3365         * UIProcess/WebInspectorProxy.h:
3366         (WebKit::WebInspectorProxy::InspectionTargetType): Added.
3367         (WebKit::WebInspectorProxy::createFrontendWindow):
3368         * UIProcess/mac/WebInspectorProxyMac.mm:
3369         (WebKit::WebInspectorProxy::createFrontendWindow):
3370         (WebKit::WebInspectorProxy::platformCreateFrontendWindow):
3371         * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
3372         (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
3373
3374         * UIProcess/API/Cocoa/_WKInspectorWindow.h: Moved from UIProcess/mac/WKInspectorWindow.h.
3375         * UIProcess/API/Cocoa/_WKInspectorWindow.mm: Moved from UIProcess/mac/WKInspectorWindow.mm.
3376         (-[WKInspectorWindow isRemote]): Added.
3377
3378         * Shared/API/Cocoa/_WKNSWindowExtras.mm:
3379         (-[NSWindow _web_isWebInspectorWindow]):
3380
3381         * PlatformMac.cmake:
3382         * SourcesCocoa.txt:
3383         * UnifiedSources-input.xcfilelist:
3384         * WebKit.xcodeproj/project.pbxproj:
3385
3386 2019-01-29  Alex Christensen  <achristensen@webkit.org>
3387
3388         Rename ChildProcess to AuxiliaryProcess
3389         https://bugs.webkit.org/show_bug.cgi?id=193943
3390
3391         Reviewed by Andy Estes.
3392
3393         "Child" implies that there is a parent, but I'm about to introduce a type of NetworkProcess that
3394         doesn't always have a parent, and may have many UIProcesses that it is the auxiliary for.
3395
3396         * CMakeLists.txt:
3397         * DerivedSources-input.xcfilelist:
3398         * DerivedSources-output.xcfilelist:
3399         * DerivedSources.make:
3400         * NetworkProcess/Cookies/WebCookieManager.cpp:
3401         * NetworkProcess/Cookies/soup/WebCookieManagerSoup.cpp:
3402         * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
3403         (WebKit::initializeAuxiliaryProcess<NetworkProcess>):
3404         (WebKit::initializeChildProcess<NetworkProcess>): Deleted.
3405         * NetworkProcess/NetworkProcess.cpp:
3406         (WebKit::callExitSoon):
3407         (WebKit::NetworkProcess::NetworkProcess):