Temporarily disable delayed WebProcess launch on iOS to address PLT regression
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-04-04  Chris Dumez  <cdumez@apple.com>
2
3         Temporarily disable delayed WebProcess launch on iOS to address PLT regression
4         https://bugs.webkit.org/show_bug.cgi?id=196604
5         <rdar://problem/49074131>
6
7         Reviewed by Geoffrey Garen.
8
9         Temporarily disable delayed WebProcess launch on iOS to address PLT regression. This
10         is while I figure out how to enable this on iOS without regressed PLT.
11
12         * UIProcess/WebProcessPool.h:
13
14 2019-04-04  Miguel Gomez  <magomez@igalia.com>
15
16         [CoordGraphics] Revalidate need for 'coordinated update completion' in ThreadedCompositor
17         https://bugs.webkit.org/show_bug.cgi?id=188839
18
19         Reviewed by Žan Doberšek.
20
21         Even if a platform layer has changed, don't wait for a main thread callback to finish the
22         CompositingRunLoop update. It can be finished as soon as we receive the frameComplete signal.
23
24         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
25         (WebKit::CompositingRunLoop::scheduleUpdate):
26         (WebKit::CompositingRunLoop::stopUpdates):
27         (WebKit::CompositingRunLoop::updateCompleted):
28         (WebKit::CompositingRunLoop::updateTimerFired):
29         (WebKit::CompositingRunLoop::compositionCompleted): Deleted.
30         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
31         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
32         (WebKit::ThreadedCompositor::renderLayerTree):
33         (WebKit::ThreadedCompositor::sceneUpdateFinished):
34         (WebKit::ThreadedCompositor::displayRefreshMonitor):
35         (WebKit::ThreadedCompositor::handleDisplayRefreshMonitorUpdate): Deleted.
36         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
37         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
38         (WebKit::LayerTreeHost::handleDisplayRefreshMonitorUpdate):
39
40 2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
41
42         [ATK] Cleanup WebPageAccessibilityObjectAtk
43         https://bugs.webkit.org/show_bug.cgi?id=196537
44
45         Reviewed by Michael Catanzaro.
46
47         Several changes and cleanups:
48
49          - Add WebKit prefix so that style checker doesn't complain about GObject conventions.
50          - Rename the header to remove the Atk prefix to match the cpp file and class name.
51          - Use pragma once.
52          - Use nullptr instead of 0.
53          - Use WEBKIT_DEFINE_TYPE instead of G_DEFINE_TYPE.
54          - Return generic AtkObject* from constructor.
55
56         * SourcesGTK.txt:
57         * WebProcess/WebPage/WebPage.h:
58         * WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.cpp: Renamed from Source/WebKit/WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp.
59         (accessibilityRootObjectWrapper):
60         (webkitWebPageAccessibilityObjectInitialize):
61         (webkitWebPageAccessibilityObjectGetIndexInParent):
62         (webkitWebPageAccessibilityObjectGetNChildren):
63         (webkitWebPageAccessibilityObjectRefChild):
64         (webkit_web_page_accessibility_object_class_init):
65         (webkitWebPageAccessibilityObjectNew):
66         (webkitWebPageAccessibilityObjectRefresh):
67         * WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.h: Added.
68         * WebProcess/WebPage/atk/WebPageAccessibilityObject.h: Removed.
69         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
70         (WebKit::WebPage::platformInitialize):
71         (WebKit::WebPage::updateAccessibilityTree):
72
73 2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
74
75         [ATK] Set ATK_STATE_TRANSIENT on the atk socket until it's embedded
76         https://bugs.webkit.org/show_bug.cgi?id=196535
77
78         Reviewed by Michael Catanzaro.
79
80         This way the properties are not cached. Right now, if number of children is queried before the socket is
81         embedded, 0 is returned and cached, so ATs don't see the child even after the socket has been embedded.
82
83         * UIProcess/API/gtk/WebKitWebViewBaseAccessible.cpp:
84         (webkitWebViewBaseAccessibleRefStateSet): Set ATK_STATE_TRANSIENT is the socket is not occupied.
85         * UIProcess/gtk/WebPageProxyGtk.cpp:
86         (WebKit::WebPageProxy::bindAccessibilityTree): Unset ATK_STATE_TRANSIENT.
87
88 2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
89
90         [ATK] Embed the AtkSocket as soon as we receive the plug ID
91         https://bugs.webkit.org/show_bug.cgi?id=196534
92
93         Reviewed by Michael Catanzaro.
94
95         We are currently storing the ID and waiting for the next time get_accessible is called to embed the socket. We
96         can simply embed the socket when the plug ID is received.
97
98         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
99         (webkitWebViewBaseGetAccessible):
100         * UIProcess/WebPageProxy.h:
101         * UIProcess/gtk/WebPageProxyGtk.cpp:
102         (WebKit::WebPageProxy::bindAccessibilityTree):
103
104 2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
105
106         [ATK] Don't touch accessibility tree in WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld
107         https://bugs.webkit.org/show_bug.cgi?id=193914
108
109         Reviewed by Michael Catanzaro.
110
111         Move it to dispatchDidFinishDocumentLoad, since we know we have the document at that point and we can create the
112         root accessibility object wrapper.
113
114         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
115         (WebKit::WebFrameLoaderClient::dispatchDidFinishDocumentLoad):
116         (WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
117
118 2019-04-03  Simon Fraser  <simon.fraser@apple.com>
119
120         Simplify some "programmaticScroll" code paths
121         https://bugs.webkit.org/show_bug.cgi?id=196589
122
123         Reviewed by Zalan Bujtas.
124
125         * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm: Remove the parameter.
126         (WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode): Use the enum type.
127         * WebProcess/WebPage/ios/WebPageIOS.mm:
128         (WebKit::WebPage::updateVisibleContentRects):
129
130 2019-04-03  Chris Dumez  <cdumez@apple.com>
131
132         The page's focusedFrame / frameSetLargestFrame do not get cleared on process swap or crash
133         https://bugs.webkit.org/show_bug.cgi?id=196588
134         <rdar://problem/49365787>
135
136         Reviewed by Ryosuke Niwa.
137
138         The page's focusedFrame / frameSetLargestFrame do not get cleared on process swap or crash.
139         This can lead to returning stale frames to the client if it asks for those.
140
141         * UIProcess/WebPageProxy.cpp:
142         (WebKit::WebPageProxy::resetState):
143
144 2019-04-03  Simon Fraser  <simon.fraser@apple.com>
145
146         Remove the isProgrammaticScroll argument to requestScroll() because no-one uses it
147         https://bugs.webkit.org/show_bug.cgi?id=196587
148
149         Reviewed by Zalan Bujtas.
150
151         This argument was unused.
152
153         * UIProcess/API/gtk/PageClientImpl.cpp:
154         (WebKit::PageClientImpl::requestScroll):
155         * UIProcess/API/gtk/PageClientImpl.h:
156         * UIProcess/API/wpe/PageClientImpl.cpp:
157         (WebKit::PageClientImpl::requestScroll):
158         * UIProcess/API/wpe/PageClientImpl.h:
159         * UIProcess/PageClient.h:
160         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
161         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
162         * UIProcess/WebPageProxy.cpp:
163         (WebKit::WebPageProxy::requestScroll):
164         * UIProcess/WebPageProxy.h:
165         * UIProcess/ios/PageClientImplIOS.h:
166         * UIProcess/ios/PageClientImplIOS.mm:
167         (WebKit::PageClientImpl::requestScroll):
168         * UIProcess/mac/PageClientImplMac.h:
169         * UIProcess/mac/PageClientImplMac.mm:
170         (WebKit::PageClientImpl::requestScroll):
171         * UIProcess/win/PageClientImpl.cpp:
172         (WebKit::PageClientImpl::requestScroll):
173         * UIProcess/win/PageClientImpl.h:
174
175 2019-04-03  Myles C. Maxfield  <mmaxfield@apple.com>
176
177         -apple-trailing-word is needed for browser detection
178         https://bugs.webkit.org/show_bug.cgi?id=196575
179
180         Unreviewed.
181
182         * Configurations/FeatureDefines.xcconfig:
183
184 2019-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
185
186         Add a WebKit internal feature flag to always enable modern compatibility mode by default
187         https://bugs.webkit.org/show_bug.cgi?id=196526
188         <rdar://problem/49532923>
189
190         Reviewed by Tim Horton.
191
192         Change UseModernCompatibilityModeByDefault from an internal preference to a debug preference, so that it may be
193         enabled for all apps on the system.
194
195         * Shared/WebPreferences.yaml:
196
197 2019-04-03  Alex Christensen  <achristensen@webkit.org>
198
199         Fix internal build after r243829
200         https://bugs.webkit.org/show_bug.cgi?id=196549
201
202         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
203         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
204         Some SDK's don't include this selector in the header.
205         Use NSSelectorFromString.
206
207 2019-04-03  Don Olmstead  <don.olmstead@sony.com>
208
209         [CMake][WTF] Mirror XCode header directories
210         https://bugs.webkit.org/show_bug.cgi?id=191662
211
212         Reviewed by Konstantin Tokarev.
213
214         Use WTFFramework as a dependency and include frameworks/WTF.cmake for AppleWin internal
215         builds.
216
217         * CMakeLists.txt:
218
219 2019-04-03  Alex Christensen  <achristensen@webkit.org>
220
221         Add SPI to disable legacy TLS fallback
222         https://bugs.webkit.org/show_bug.cgi?id=196549
223         <rdar://44979744>
224
225         Reviewed by Geoffrey Garen.
226
227         * NetworkProcess/NetworkSessionCreationParameters.cpp:
228         (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
229         (WebKit::NetworkSessionCreationParameters::encode const):
230         (WebKit::NetworkSessionCreationParameters::decode):
231         * NetworkProcess/NetworkSessionCreationParameters.h:
232         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
233         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
234         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
235         (-[WKWebsiteDataStore _setAllowsTLSFallback:]):
236         (-[WKWebsiteDataStore _allowsTLSFallback]):
237         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
238         * UIProcess/WebProcessPool.cpp:
239         (WebKit::WebProcessPool::ensureNetworkProcess):
240         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
241         (WebKit::WebsiteDataStore::parameters):
242         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
243         (WebKit::WebsiteDataStore::setSourceApplicationSecondaryIdentifier):
244         (WebKit::WebsiteDataStore::setAllowsTLSFallback):
245         (WebKit::WebsiteDataStore::setSourceApplicationBundleIdentifier):
246         * UIProcess/WebsiteData/WebsiteDataStore.h:
247         (WebKit::WebsiteDataStore::allowsTLSFallback const):
248         (WebKit::WebsiteDataStore::networkingHasBegun):
249         (WebKit::WebsiteDataStore::finalizeApplicationIdentifiers): Deleted.
250
251 2019-04-03  Myles C. Maxfield  <mmaxfield@apple.com>
252
253         Remove support for -apple-trailing-word
254         https://bugs.webkit.org/show_bug.cgi?id=196525
255
256         Reviewed by Zalan Bujtas.
257
258         This CSS property is nonstandard and not used.
259
260         * Configurations/FeatureDefines.xcconfig:
261
262 2019-04-03  Alex Christensen  <achristensen@webkit.org>
263
264         Resurrect and fix layout test http/tests/adClickAttribution/store-ad-click-attribution.html
265         https://bugs.webkit.org/show_bug.cgi?id=196476
266
267         Reviewed by Chris Dumez.
268
269         Re-apply a change I reverted in r241754 now that it's safe to do so.
270
271         * UIProcess/WebPageProxy.cpp:
272         (WebKit::WebPageProxy::didCommitLoadForFrame):
273
274 2019-04-03  Daniel Bates  <dabates@apple.com>
275
276         [iOS] Should be able to dismiss picker or popover using the keyboard
277         https://bugs.webkit.org/show_bug.cgi?id=196272
278         <rdar://problem/48943170>
279
280         Reviewed by Wenson Hsieh.
281
282         Intercept key events and route them to the current input peripheral (if we have one). Add a base key event handler
283         for all form peripherals that dismisses the accessory when either the Escape key is pressed or Command + . is pressed.
284         I will fix this issue for the file upload picker/popover in <https://bugs.webkit.org/show_bug.cgi?id=196287>.
285
286         * SourcesCocoa.txt: Add file WKFormPeripheralBase.mm.
287         * UIProcess/ios/WKContentViewInteraction.mm:
288         (-[WKContentView endEditingAndUpdateFocusAppearanceWithReason]): Added.
289         (-[WKContentView resignFirstResponderForWebView]): Write in terms of -endEditingAndUpdateFocusAppearance.
290         (-[WKContentView inputView]): Code style nit while I am here; add an empty line to demarcate the "crazy"
291         code that the FIXME is referring to and should ideally be removed from the code that is sane to always do.
292         (-[WKContentView accessoryDone]): When the accessory is dismissed via the Done button (iPhone) or by pressing
293         Escape or Command + . using a hardware keyboard (iPhone or iPad) then end the current editing session, but
294         do not resign first responder status as the page activation state should not be changed.
295         (-[WKContentView _handleKeyUIEvent:]): Bring back this code when building with USE(UIKIT_KEYBOARD_ADDITIONS)
296         as we need to route key events to the input peripheral (if we have one). If the input peripheral handles it
297         then we're done: no need to let UIKit or WebKit handle it when building with USE(UIKIT_KEYBOARD_ADDITIONS),
298         respectively. If the input peripheral does not handle it then do what we do now.
299         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
300         If the element is re-focused and we have an input peripheral then we want to ensure we are first responder,
301         reveal the focused element, update the accessory and tell the peripheral that editing has begun (again).
302         For all other element re-focusing where we don't have a peripheral do what we do now. Also, update _isEditable
303         to reflect whether the focused element contains selectable text. This is what UIKit wants to know when it queries
304         -isEditable. Now that we no longer blur the focused element on iPad when the popover is dismissed and keep the
305         peripheral until there is a focus change we need to ensure that we give the correct answer to UIKit on view
306         editability. Otherwise, UIKit thinks it needs to update the text selection state when a popup button is tapped
307         again (as part of its gesture recognizer logic) and this causes an assertion failure in UIKit after it calls back
308         into us to ask for selection details, which we correctly respond with the equivalent of "we have none" and is
309         not the answer UIKit expects since we told it we are editable. (Currently we manage to get away with telling UIKit
310         we are always editable because it is not possible to perform a selection operation when we have a popover open.
311         Closing the popover blurs the element, setting -isEditable to NO and deallocates the peripheral avoiding this issue).
312         * UIProcess/ios/forms/WKFormColorControl.h:
313         * UIProcess/ios/forms/WKFormColorControl.mm:
314         (-[WKColorPopover controlEndEditing]): Dismiss the popover.
315         (-[WKFormColorControl initWithView:]): Modified to call base class initializer.
316         (-[WKFormColorControl assistantView]): Deleted.
317         (-[WKFormColorControl beginEditing]): Deleted.
318         (-[WKFormColorControl endEditing]): Deleted.
319         * UIProcess/ios/forms/WKFormInputControl.h:
320         * UIProcess/ios/forms/WKFormInputControl.mm:
321         (-[WKFormInputControl initWithView:]): Modified to call base class initializer.
322         (-[WKFormInputControl dateTimePickerCalendarType]): Write in terms of self.control.
323         (-[WKDateTimePopover controlEndEditing]): Dismiss the popover and tell the controller that editing ended.
324         (-[WKFormInputControl beginEditing]): Deleted.
325         (-[WKFormInputControl endEditing]): Deleted.
326         (-[WKFormInputControl assistantView]): Deleted.
327         * UIProcess/ios/forms/WKFormPeripheral.h:
328         * UIProcess/ios/forms/WKFormPeripheralBase.h: Added.
329         * UIProcess/ios/forms/WKFormPeripheralBase.mm: Added.
330         (-[WKFormPeripheralBase initWithView:control:]): Take ownership of the passed WKFormControl.
331         (-[WKFormPeripheralBase beginEditing]): Turn around and tell the control.
332         (-[WKFormPeripheralBase endEditing]): Ditto.
333         (-[WKFormPeripheralBase assistantView]): Ditto.
334         (-[WKFormPeripheralBase control]): Return the control.
335         (-[WKFormPeripheralBase handleKeyEvent:]): Dismiss the accessory (in the same way we dismiss when the Done
336         button is pressed on iPhone) on keydown of the Escape key or when we receive a UIKeyInputEscape event (for
337         Command + .).
338         * UIProcess/ios/forms/WKFormSelectControl.h:
339         * UIProcess/ios/forms/WKFormSelectControl.mm:
340         (-[WKFormSelectControl initWithView:]): Modified to call base class initializer.
341         (-[WKFormSelectControl selectRow:inComponent:extendingSelection:]): Write in terms of self.control.
342         (-[WKFormSelectControl selectFormPopoverTitle]): Ditto.
343         (-[WKFormSelectControl assistantView]): Deleted.
344         (-[WKFormSelectControl beginEditing]): Deleted.
345         (-[WKFormSelectControl endEditing]): Deleted.
346         * UIProcess/ios/forms/WKFormSelectPopover.mm:
347         (-[WKSelectPopover controlEndEditing]): Dismiss the popover.
348         * WebKit.xcodeproj/project.pbxproj: Add files WKFormPeripheralBase.{h, mm}.
349
350 2019-04-03  Youenn Fablet  <youenn@apple.com>
351
352         Resetting quota should take into account third party origins
353         https://bugs.webkit.org/show_bug.cgi?id=196462
354
355         Reviewed by Geoffrey Garen.
356
357         When clearing the storage quota, we were resetting it to the default value
358         without taking care of whether third party or not.
359         Updated the code to ensure that the default quota is computed based on the origin.
360
361         Updated existing test to cover this case.
362
363         * NetworkProcess/NetworkProcess.cpp:
364         (WebKit::NetworkProcess::clearStorageQuota):
365         (WebKit::NetworkProcess::setCacheStorageParameters):
366         (WebKit::NetworkProcess::updateQuotaBasedOnSpaceUsageForTesting):
367         (WebKit::NetworkProcess::storageQuotaManager):
368         * NetworkProcess/NetworkProcess.h:
369         (WebKit::NetworkProcess::StorageQuotaManagers::defaultQuota const):
370         (WebKit::NetworkProcess::StorageQuotaManagers::setDefaultQuotas):
371         (WebKit::NetworkProcess::StorageQuotaManagers::managersPerOrigin):
372
373 2019-04-03  Michael Catanzaro  <mcatanzaro@igalia.com>
374
375         Get rid of HTMLInputElement::setEditingValue
376         https://bugs.webkit.org/show_bug.cgi?id=196402
377
378         Reviewed by Darin Adler.
379
380         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMElement.cpp:
381         (webkit_dom_element_html_input_element_set_editing_value):
382         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
383         (webkit_dom_html_input_element_set_editing_value):
384
385 2019-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
386
387         Add a WebKit internal feature flag to always enable modern compatibility mode by default
388         https://bugs.webkit.org/show_bug.cgi?id=196526
389         <rdar://problem/49532923>
390
391         Reviewed by Antoine Quint.
392
393         * Shared/WebPreferences.yaml:
394
395 2019-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
396
397         Introduce and add plumbing for a website policy for meta viewport tag handling
398         https://bugs.webkit.org/show_bug.cgi?id=196285
399
400         Reviewed by Tim Horton.
401
402         Add WebsiteMetaViewportPolicy, a bit that can be used to determine whether to respect or ignore the meta
403         viewport tag and use native web page parameters instead of the default parameters.
404
405         * Shared/WebsiteMetaViewportPolicy.h: Copied from Source/WebKit/Shared/WebsitePoliciesData.h.
406         * Shared/WebsitePoliciesData.cpp:
407         (WebKit::WebsitePoliciesData::encode const):
408         (WebKit::WebsitePoliciesData::decode):
409         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
410
411         Convert WebKit::WebsiteMetaViewportPolicy into WebCore::MetaViewportPolicy.
412
413         * Shared/WebsitePoliciesData.h:
414         * UIProcess/API/APIWebsitePolicies.cpp:
415         (API::WebsitePolicies::data):
416         * UIProcess/API/APIWebsitePolicies.h:
417
418         Add additional plumbing for the policy flag.
419
420         * WebKit.xcodeproj/project.pbxproj:
421         * WebProcess/WebPage/ios/WebPageIOS.mm:
422         (WebKit::WebPage::resetViewportDefaultConfiguration):
423
424         Use native web page parameters if either "shouldIgnoreMetaViewport" is enabled, or the new policy is set.
425         Eventually, the policy should completely replace the former preference once no internal clients depend on it.
426
427 2019-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
428
429         Add plumbing for a compatibility mode preference in WebKit
430         https://bugs.webkit.org/show_bug.cgi?id=196005
431
432         Reviewed by Tim Horton.
433
434         Add plumbing between the Cocoa API object (WKWebpagePreferences) and the inner C++ API object
435         (API::WebsitePolicies) for compatibility mode.
436
437         * Shared/WebCompatibilityMode.h: Added.
438         * UIProcess/API/APIWebsitePolicies.h:
439         * UIProcess/API/Cocoa/WKWebpagePreferences.mm:
440         * UIProcess/Cocoa/NavigationState.mm:
441         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
442         * UIProcess/WebPageProxy.cpp:
443         (WebKit::WebPageProxy::adjustPoliciesForCompatibilityMode):
444         * UIProcess/WebPageProxy.h:
445         * UIProcess/ios/WebPageProxyIOS.mm:
446         * WebKit.xcodeproj/project.pbxproj:
447
448 2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
449
450         [CoordinatedGraphics] Hidden pages are not suspended after a web view resize
451         https://bugs.webkit.org/show_bug.cgi?id=196487
452
453         Reviewed by Žan Doberšek.
454
455         When resizing the window, the hidden tabs are updated too, to avoid flickering or getting the old size when
456         switching tabs. For that we need to resume painting but we are not suspending it again after the update.
457
458         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
459         (WebKit::DrawingAreaCoordinatedGraphics::updateBackingStoreState): Suspend the painting again after a
460         synchronous update if needed.
461
462 2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
463
464         Web Inspector: [GTK] Copy copies to nowhere
465         https://bugs.webkit.org/show_bug.cgi?id=181228
466
467         Reviewed by Michael Catanzaro.
468
469         The thing is that those items are actually submenu items, with options, for example in the case of Copy to copy
470         HTML, Text, XPath, etc. We are not correctly handling submenus when populating the context menu received from
471         the web process.
472
473         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
474         (WebKit::WebContextMenuProxyGtk::populateSubMenu): Helper to populate submenu items recursively.
475         (WebKit::WebContextMenuProxyGtk::populate): Handle submenu items.
476         * UIProcess/gtk/WebContextMenuProxyGtk.h:
477
478 2019-04-02  Wenson Hsieh  <wenson_hsieh@apple.com>
479
480         [Cocoa] Add new API around WKWebpagePreferences in WKNavigationDelegate and WKWebViewConfiguration
481         https://bugs.webkit.org/show_bug.cgi?id=196284
482         <rdar://problem/47228232>
483
484         Reviewed by Tim Horton.
485
486         Tests for both of these APIs will be added in a subsequent patch.
487
488         * Shared/API/Cocoa/WebKit.h:
489         * UIProcess/API/APIPageConfiguration.cpp:
490         (API::PageConfiguration::defaultWebsitePolicies const):
491         (API::PageConfiguration::setDefaultWebsitePolicies):
492         * UIProcess/API/APIPageConfiguration.h:
493         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
494
495         Add a new navigation delegate hook to allow clients to return a WKWebpagePreference targeting the given
496         navigation action.
497
498         * UIProcess/API/Cocoa/WKWebView.mm:
499         (-[WKWebView _initializeWithConfiguration:]):
500         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
501         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
502
503         Add new API on WKWebViewConfiguration to specify a default WKWebpagePreference to use when navigating.
504
505         (-[WKWebViewConfiguration copyWithZone:]):
506         (-[WKWebViewConfiguration defaultWebpagePreferences]):
507         (-[WKWebViewConfiguration setDefaultWebpagePreferences:]):
508         * UIProcess/API/Cocoa/WKWebpagePreferences.h:
509         * UIProcess/Cocoa/NavigationState.h:
510         * UIProcess/Cocoa/NavigationState.mm:
511         (WebKit::NavigationState::setNavigationDelegate):
512         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
513
514         Invoke the new WKWebpagePreferences-based navigation delegate method.
515
516         * WebKit.xcodeproj/project.pbxproj:
517         * mac/postprocess-framework-headers.sh:
518         * mac/replace-webkit-additions-in-framework-headers.sh: Added.
519
520         Move logic in the "Postprocess Framework Headers" step responsible for stripping away included files from
521         WebKitAdditions out into a separate build phase, called "Replace WebKitAdditions in Framework Headers". This
522         ensures headers attempting to include from WebKitAdditions have these additional statements removed.
523
524 2019-04-02  Geoffrey Garen  <ggaren@apple.com>
525
526         Eliminate plugin sandbox exceptions
527         https://bugs.webkit.org/show_bug.cgi?id=196510
528
529         Reviewed by Chris Dumez.
530
531         * PluginProcess/mac/PluginProcessMac.mm:
532         (WebKit::PluginProcess::initializeSandbox):
533         * UIProcess/Plugins/PluginInfoStore.cpp:
534         (WebKit::PluginInfoStore::shouldAllowPluginToRunUnsandboxed): Deleted.
535         * UIProcess/Plugins/PluginInfoStore.h:
536         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
537         (WebKit::PluginInfoStore::shouldUsePlugin):
538         (WebKit::PluginInfoStore::shouldAllowPluginToRunUnsandboxed): Deleted.
539
540 2019-04-02  Alex Christensen  <achristensen@webkit.org>
541
542         Fix assertion in http/tests/adClickAttribution/store-ad-click-attribution.html
543         https://bugs.webkit.org/show_bug.cgi?id=196503
544
545         Reviewed by Chris Dumez.
546
547         In WebPageProxy::didDestroyNavigation we try to ignore a request to destroy a navigation from a page being navigated from
548         during a cross-site navigation, but if the old web process sends the message after WebPageProxy::commitProvisionalPage
549         has been called, we can still destroy a navigation when we are continuing a navigation in another process.  To prevent this,
550         have the process not send the message when it knows the navigation is continuing in another process.
551         Also make the use of unchecked navigation pointers more robust by checking it for nullity.
552
553         * UIProcess/WebPageProxy.cpp:
554         (WebKit::WebPageProxy::didCommitLoadForFrame):
555         * WebProcess/WebPage/WebFrame.cpp:
556         (WebKit::WebFrame::didReceivePolicyDecision):
557         (WebKit::WebFrame::documentLoaderDetached):
558         * WebProcess/WebPage/WebFrame.h:
559
560 2019-04-02  Per Arne Vollan  <pvollan@apple.com>
561
562         [iOS] Fix iokit-get-properties sandbox violation in the WebContent process
563         https://bugs.webkit.org/show_bug.cgi?id=196500
564         <rdar://problem/49497788>
565
566         Reviewed by Brent Fulgham.
567
568         Attempting to get the iokit properties 'product-description', 'artwork-display-gamut' and
569         'artwork-scale-factor' is causing sandbox violations.
570
571         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
572
573 2019-04-02  Chris Dumez  <cdumez@apple.com>
574
575         [WK2] Add support for Window's beforeprint / afterprint events
576         https://bugs.webkit.org/show_bug.cgi?id=196478
577
578         Reviewed by Alex Christensen.
579
580         Add support for Window's beforeprint / afterprint events as per:
581         - https://html.spec.whatwg.org/#dom-print
582
583         Blink and Gecko already support this.
584
585         * WebProcess/WebPage/WebPage.cpp:
586         (WebKit::WebPage::beginPrinting):
587         (WebKit::WebPage::endPrinting):
588
589 2019-04-02  Wenson Hsieh  <wenson_hsieh@apple.com>
590
591         REGRESSION (r243726): Crash at unrecognized selector: -[WKWebpagePreferences webpagePreferences]
592         https://bugs.webkit.org/show_bug.cgi?id=196496
593         <rdar://problem/49521634>
594
595         Reviewed by Chris Dumez.
596
597         r243726 made an incorrect assumption that all callers of -decidePolicyForNavigationAction:decisionHandler: and
598         -decidePolicyForNavigationAction:userInfo:decisionHandler: must be instances of _WKWebsitePolicies, as opposed
599         to the new WKWebpagePreferences. However, it's possible for clients (in this case, Safari) to already generate
600         and pass in an instance of WKWebpagePreferences by bridging the C API opaque ref (WKWebsitePoliciesRef) into the
601         Objective-C object (which is now WKWebpagePreferences, after my change).
602
603         To maintain binary compatibility of trunk WebKit against prior versions of Safari, we need to handle both
604         WKWebpagePreferences and the soon-to-be-deprecated _WKWebsitePolicies in the navigation action policy decision
605         handler.
606
607         Tests:  WebKit.WebsitePoliciesWithBridgingCast
608                 WebKit.WebsitePoliciesWithUnexpectedType
609
610         * UIProcess/Cocoa/NavigationState.mm:
611         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
612
613 2019-04-01  Chris Dumez  <cdumez@apple.com>
614
615         Unreviewed, drop debug logging landed as part of r242903 by mistake.
616
617         * UIProcess/WebPageProxy.cpp:
618         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
619
620 2019-04-01  Remy Demarest  <rdemarest@apple.com>
621
622         Add SPI to give injected bundles access to displayed PDFDocuments
623         https://bugs.webkit.org/show_bug.cgi?id=196471
624         <rdar://problem/48080768>
625
626         Reviewed by Tim Horton.
627
628         * WebKit.xcodeproj/project.pbxproj:
629
630         * WebProcess/InjectedBundle/API/c/mac/WKBundlePageMac.h: Added.
631         * WebProcess/InjectedBundle/API/c/mac/WKBundlePageMac.mm: Added.
632         (WKBundlePageGetPDFDocumentInFrame):
633
634 2019-04-01  Wenson Hsieh  <wenson_hsieh@apple.com>
635
636         [WebKit2] Introduce a public version of WKWebsitePolicies
637         https://bugs.webkit.org/show_bug.cgi?id=195989
638         <rdar://problem/47228232>
639
640         Reviewed by Tim Horton.
641
642         Expose the existing _WKWebsitePolicies object as WKWebpagePreferences, in what will eventually become a public
643         header in the WebKit SDK (WKWebpagePreferences.h). Following a similar transitioning strategy as
644         _WKWebsiteDataStore and WKWebsiteDataStore, we move existing logic from _WKWebsitePolicies to WKWebpagePreferences
645         and make _WKWebsitePolicies a wrapper around WKWebpagePreferences.
646
647         No change in behavior.
648
649         * Shared/Cocoa/APIObject.mm:
650         (API::Object::newObject):
651
652         Wrap API::WebsitePolicies with WKWebpagePreferences.
653
654         * SourcesCocoa.txt:
655         * UIProcess/API/Cocoa/WKWebView.mm:
656         (-[WKWebView _updateWebsitePolicies:]):
657         * UIProcess/API/Cocoa/WKWebpagePreferences.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h.
658         * UIProcess/API/Cocoa/WKWebpagePreferences.mm: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePolicies.mm.
659
660         Introduce WKWebpagePreferences.
661
662         (+[WKWebpagePreferences defaultPreferences]):
663         (-[WKWebpagePreferences dealloc]):
664         (-[WKWebpagePreferences init]):
665         (-[WKWebpagePreferences _setContentBlockersEnabled:]):
666         (-[WKWebpagePreferences _contentBlockersEnabled]):
667         (-[WKWebpagePreferences _setAllowedAutoplayQuirks:]):
668         (-[WKWebpagePreferences _allowedAutoplayQuirks]):
669         (-[WKWebpagePreferences _setAutoplayPolicy:]):
670         (-[WKWebpagePreferences _autoplayPolicy]):
671         (-[WKWebpagePreferences _setDeviceOrientationAndMotionAccessPolicy:]):
672         (-[WKWebpagePreferences _deviceOrientationAndMotionAccessPolicy]):
673         (-[WKWebpagePreferences _setPopUpPolicy:]):
674         (-[WKWebpagePreferences _popUpPolicy]):
675         (-[WKWebpagePreferences _customHeaderFields]):
676         (-[WKWebpagePreferences _setCustomHeaderFields:]):
677         (-[WKWebpagePreferences _websiteDataStore]):
678         (-[WKWebpagePreferences _setWebsiteDataStore:]):
679         (-[WKWebpagePreferences _setCustomUserAgent:]):
680         (-[WKWebpagePreferences _customUserAgent]):
681         (-[WKWebpagePreferences _setCustomJavaScriptUserAgentAsSiteSpecificQuirks:]):
682         (-[WKWebpagePreferences _customJavaScriptUserAgentAsSiteSpecificQuirks]):
683         (-[WKWebpagePreferences _setCustomNavigatorPlatform:]):
684         (-[WKWebpagePreferences _customNavigatorPlatform]):
685         (-[WKWebpagePreferences _apiObject]):
686         * UIProcess/API/Cocoa/WKWebpagePreferencesInternal.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h.
687         * UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePolicies.h.
688
689         Reintroduce all the interfaces currently available on _WKWebsitePolicies as underscore-prefixed SPI on
690         WKWebpagePreferences.
691
692         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
693         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
694
695         Make _WKWebsitePolicies wrap WKWebpagePreferences, and plumb all existing SPI on WKWebsitePolicies through to
696         WKWebpagePreferences.
697
698         (-[_WKWebsitePolicies init]):
699         (-[_WKWebsitePolicies webpagePreferences]):
700         (-[_WKWebsitePolicies setContentBlockersEnabled:]):
701         (-[_WKWebsitePolicies contentBlockersEnabled]):
702         (-[_WKWebsitePolicies setAllowedAutoplayQuirks:]):
703         (-[_WKWebsitePolicies allowedAutoplayQuirks]):
704         (-[_WKWebsitePolicies setAutoplayPolicy:]):
705         (-[_WKWebsitePolicies autoplayPolicy]):
706         (-[_WKWebsitePolicies setDeviceOrientationAndMotionAccessPolicy:]):
707         (-[_WKWebsitePolicies deviceOrientationAndMotionAccessPolicy]):
708         (-[_WKWebsitePolicies setPopUpPolicy:]):
709         (-[_WKWebsitePolicies popUpPolicy]):
710         (-[_WKWebsitePolicies customHeaderFields]):
711         (-[_WKWebsitePolicies setCustomHeaderFields:]):
712         (-[_WKWebsitePolicies websiteDataStore]):
713         (-[_WKWebsitePolicies setWebsiteDataStore:]):
714         (-[_WKWebsitePolicies setCustomUserAgent:]):
715         (-[_WKWebsitePolicies customUserAgent]):
716         (-[_WKWebsitePolicies setCustomJavaScriptUserAgentAsSiteSpecificQuirks:]):
717         (-[_WKWebsitePolicies customJavaScriptUserAgentAsSiteSpecificQuirks]):
718         (-[_WKWebsitePolicies setCustomNavigatorPlatform:]):
719         (-[_WKWebsitePolicies customNavigatorPlatform]):
720         (-[_WKWebsitePolicies description]):
721         (-[_WKWebsitePolicies _apiObject]):
722         (-[_WKWebsitePolicies dealloc]): Deleted.
723         * UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h:
724         * UIProcess/Cocoa/NavigationState.mm:
725         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
726         * WebKit.xcodeproj/project.pbxproj:
727
728 2019-04-01  Wenson Hsieh  <wenson_hsieh@apple.com>
729
730         Unable to copy and paste a PDF from Notes into Mail compose body
731         https://bugs.webkit.org/show_bug.cgi?id=196442
732         <rdar://problem/48573098>
733
734         Reviewed by Tim Horton.
735
736         Relax the -canPerformAction: logic in the case of pasting an attachment. Consider an NSItemProvider to possibly
737         paste as an attachment if either it has a preferred presentation style of UIPreferredPresentationStyleAttachment
738         or has a style of UIPreferredPresentationStyleUnspecified, but has a suggested file name.
739
740         This allows for the "Paste" action to be shown in the callout menu when copying and pasting a non-text file.
741
742         * UIProcess/ios/WKContentViewInteraction.mm:
743         (-[WKContentView canPerformActionForWebView:withSender:]):
744
745 2019-04-01  Tim Horton  <timothy_horton@apple.com>
746
747         Make UIWKDocumentContext rects per-character instead of per-word
748         https://bugs.webkit.org/show_bug.cgi?id=196459
749
750         Reviewed by Wenson Hsieh.
751
752         * WebProcess/WebPage/ios/WebPageIOS.mm:
753         (WebKit::WebPage::requestDocumentEditingContext):
754         Switch to CharacterIterator instead of TextIterator directly, to get
755         per-character rects as the API requests.
756
757 2019-04-01  Chris Dumez  <cdumez@apple.com>
758
759         UIProcess crash when a prewarmed process is terminated
760         https://bugs.webkit.org/show_bug.cgi?id=196451
761         <rdar://problem/49245471>
762
763         Reviewed by Geoffrey Garen.
764
765         Stop assuming that WebProcessProxy::m_websiteDataStore is non-null as this is no longer
766         true after r243384. For example, prewarmed WebContent processe do not get a data store
767         until they actually get used.
768
769         * UIProcess/API/Cocoa/WKProcessPool.mm:
770         (-[WKProcessPool _prewarmedProcessIdentifier]):
771         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
772         * UIProcess/WebProcessPool.cpp:
773         (WebKit::WebProcessPool::networkProcessIdentifier):
774         (WebKit::WebProcessPool::prewarmedProcessIdentifier):
775         * UIProcess/WebProcessPool.h:
776         * UIProcess/WebProcessProxy.cpp:
777         (WebKit::WebProcessProxy::didClose):
778         (WebKit::WebProcessProxy::didFinishLaunching):
779         (WebKit::WebProcessProxy::requestTermination):
780         (WebKit::WebProcessProxy::isReleaseLoggingAllowed const):
781         * UIProcess/WebProcessProxy.h:
782
783 2019-04-01  Patrick Griffis  <pgriffis@igalia.com>
784
785         [GTK][WPE] Add more websitedatastore directories to web process sandbox
786         https://bugs.webkit.org/show_bug.cgi?id=196447
787
788         Reviewed by Michael Catanzaro.
789
790         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
791         (WebKit::bubblewrapSpawn):
792         * UIProcess/glib/WebProcessProxyGLib.cpp:
793         (WebKit::WebProcessProxy::platformGetLaunchOptions):
794
795 2019-04-01  Per Arne Vollan  <pvollan@apple.com>
796
797         [macOS] Crash when loading Twitter with autoplay video enabled.
798         https://bugs.webkit.org/show_bug.cgi?id=196446
799         <rdar://problem/49060359>
800
801         Reviewed by Brent Fulgham.
802
803         This is caused by a syscall violation.
804
805         * WebProcess/com.apple.WebProcess.sb.in:
806
807 2019-04-01  Patrick Griffis  <pgriffis@igalia.com>
808
809         [GTK][WPE] Fix seccomp rule for blacklisting TIOCSTI
810         https://bugs.webkit.org/show_bug.cgi?id=196297
811
812         Reviewed by Michael Catanzaro.
813
814         More information can be found here: https://www.exploit-db.com/exploits/46594
815
816         Note that this sandbox never made it into production so does not
817         warrant any CVE specific to WebKit.
818
819         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
820         (WebKit::setupSeccomp):
821
822 2019-03-31  Wenson Hsieh  <wenson_hsieh@apple.com>
823
824         [iOS] Crash when changing inputmode for certain types of focusable elements
825         https://bugs.webkit.org/show_bug.cgi?id=196431
826         <rdar://problem/49454962>
827
828         Reviewed by Tim Horton.
829
830         The crash is happening because WebPage::focusedElementDidChangeInputMode assumes that the document's focused
831         element must be the same as m_focusedElement in WebPage. However, this is not the case, since m_focusedElement
832         is only set for certain types of elements that require user input (e.g. text fields, editable content, select
833         menus, etc.). The function then attempts to dereference m_focusedElement, which may be null if the document's
834         focused element doesn't fall into one of the aforementioned categories.
835
836         To fix this, bail if the element that is changing inputmode is not equal to the WebPage's current focused
837         element. See below for more details.
838
839         Test: fast/forms/change-inputmode-crash.html
840
841         * WebProcess/WebPage/WebPage.cpp:
842         (WebKit::isTextFormControlOrEditableContent):
843
844         Clean up some existing logic by introducing a helper method for determining whether an element should
845         propagate inputmode attribute changes to the UI process. Also, check the element type using type traits instead
846         of checking against the tag name.
847
848         (WebKit::WebPage::elementDidFocus):
849         (WebKit::WebPage::focusedElementDidChangeInputMode):
850
851 2019-03-31  Sam Weinig  <weinig@apple.com>
852
853         Remove more i386 specific configurations
854         https://bugs.webkit.org/show_bug.cgi?id=196430
855
856         Reviewed by Alexey Proskuryakov.
857
858         * Configurations/BaseTarget.xcconfig:
859         WK_HAVE_CORE_PREDICTION can now be enabled unconditionally.
860  
861         * Configurations/FeatureDefines.xcconfig:
862         ENABLE_WEB_AUTHN_macosx can now be enabled unconditionally on macOS.
863
864 2019-03-31  Andy Estes  <aestes@apple.com>
865
866         [iOS] WebKit should consult the navigation response policy delegate before previewing a QuickLook document
867         https://bugs.webkit.org/show_bug.cgi?id=196433
868         <rdar://problem/49293305>
869
870         Reviewed by Tim Horton.
871
872         Added WKWebViewConfiguration SPI for setting the QuickLook navigation response policy
873         decision behavior. The configuration setting defaults to YES for clients linked on or after
874         this WebKit change and NO otherwise.
875
876         * NetworkProcess/NetworkResourceLoader.cpp:
877         (WebKit::NetworkResourceLoader::shouldInterruptLoadForCSPFrameAncestorsOrXFrameOptions):
878         * Shared/WebPreferences.yaml:
879         * Shared/ios/QuickLookDocumentData.cpp:
880         (WebKit::QuickLookDocumentData::isEmpty const):
881         * Shared/ios/QuickLookDocumentData.h:
882         * UIProcess/API/Cocoa/WKWebView.mm:
883         (-[WKWebView _initializeWithConfiguration:]):
884         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
885         (defaultShouldDecidePolicyBeforeLoadingQuickLookPreview):
886         (-[WKWebViewConfiguration init]):
887         (-[WKWebViewConfiguration encodeWithCoder:]):
888         (-[WKWebViewConfiguration initWithCoder:]):
889         (-[WKWebViewConfiguration copyWithZone:]):
890         (-[WKWebViewConfiguration _shouldDecidePolicyBeforeLoadingQuickLookPreview]):
891         (-[WKWebViewConfiguration _setShouldDecidePolicyBeforeLoadingQuickLookPreview:]):
892         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
893         * UIProcess/Cocoa/VersionChecks.h:
894         * WebProcess/WebCoreSupport/ios/WebPreviewLoaderClient.cpp:
895         (WebKit::WebPreviewLoaderClient::didReceiveDataArray):
896
897 2019-03-30  Zalan Bujtas  <zalan@apple.com>
898
899         [ContentChangeObserver] Subframe load should not reset content observation on the mainframe
900         https://bugs.webkit.org/show_bug.cgi?id=196408
901         <rdar://problem/49436797>
902
903         Reviewed by Simon Fraser.
904
905         Hover intent fails when an unrelated frame commits a load the same time.
906         cancelPotentialTapInFrame is called from didCommitLoad, but what we are looking for here is the user initiated cancel of a tap (cancelPotentialTap).
907         (If the current frame navigates away, willDetachPage takes care of canceling the observation.)
908
909         * WebProcess/WebPage/ios/WebPageIOS.mm:
910         (WebKit::WebPage::cancelPotentialTap):
911         (WebKit::WebPage::cancelPotentialTapInFrame):
912
913 2019-03-29  John Wilander  <wilander@apple.com>
914
915         Move WebResourceLoadStatisticsStore IPC calls from the UI process to the network process
916         https://bugs.webkit.org/show_bug.cgi?id=196407
917         <rdar://problem/47859936>
918
919         Reviewed by Brent Fulgham.
920
921         The two WebResourceLoadStatisticsStore IPC endpoints were left behind when we
922         moved Resource Load Statistics from the UI process to the network process. One
923         of the endpoints is the message RequestStorageAccessUnderOpener which underpins
924         our compatibility fix for federated logins using popups. This patch redirects
925         these IPC calls to the network process and cleans up some assumptions around
926         them.
927
928         * CMakeLists.txt:
929             Removed the old IPC receiver.
930         * DerivedSources.make:
931             Removed the old IPC receiver.
932         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
933         (WebKit::WebResourceLoadStatisticsStore::requestUpdate): Deleted.
934             This is no longer needed since there is a dedicated update mechanism
935             that actually sends the update.
936         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
937         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
938         (WebKit::NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated):
939         (WebKit::NetworkConnectionToWebProcess::requestStorageAccessUnderOpener):
940             Two new IPC receivers to pipe the calls to the network process.
941         (WebKit::NetworkConnectionToWebProcess::requestResourceLoadStatisticsUpdate): Deleted.
942             NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated now serves
943             this purpose.
944         * NetworkProcess/NetworkConnectionToWebProcess.h:
945         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
946         * UIProcess/WebResourceLoadStatisticsStore.messages.in: Removed.
947             Removed the old IPC receiver.
948         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
949         * WebKit.xcodeproj/project.pbxproj:
950         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
951         (WKBundleResourceLoadStatisticsNotifyObserver):
952             Function name update.
953         * WebProcess/WebProcess.cpp:
954             Now calls IPC to the network process instead of the UI process.
955
956 2019-03-29  Myles C. Maxfield  <mmaxfield@apple.com>
957
958         Delete WebMetal implementation in favor of WebGPU
959         https://bugs.webkit.org/show_bug.cgi?id=195418
960
961         Reviewed by Dean Jackson.
962
963         * Configurations/FeatureDefines.xcconfig:
964         * Shared/WebPreferences.yaml:
965         * WebProcess/InjectedBundle/InjectedBundle.cpp:
966         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
967
968 2019-03-29  Takashi Komori  <Takashi.Komori@sony.com>
969
970         [Curl] Add Server Trust Evaluation Support.
971         https://bugs.webkit.org/show_bug.cgi?id=191646
972
973         Reviewed by Fujii Hironori.
974
975         Tests: http/tests/ssl/iframe-upgrade.https.html
976                http/tests/ssl/mixedContent/insecure-websocket.html
977                http/tests/ssl/upgrade-origin-usage.html
978
979         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
980         (WebKit::NetworkDataTaskCurl::curlDidFailWithError):
981         (WebKit::NetworkDataTaskCurl::tryServerTrustEvaluation):
982         (WebKit::NetworkDataTaskCurl::restartWithCredential):
983         * NetworkProcess/curl/NetworkDataTaskCurl.h:
984
985 2019-03-29  Cathie Chen  <cathiechen@igalia.com>
986
987         Implement ResizeObserver.
988         https://bugs.webkit.org/show_bug.cgi?id=157743
989
990         Reviewed by Simon Fraser.
991
992         Add WebPreferences and FeatureDefines for ResizeObserver.
993
994         * Configurations/FeatureDefines.xcconfig:
995         * Shared/WebPreferences.yaml:
996
997 2019-03-28  Timothy Hatcher  <timothy@apple.com>
998
999         CFDictionary encoder crashes on non-string keys.
1000         https://bugs.webkit.org/show_bug.cgi?id=196388
1001         rdar://problem/49339242
1002
1003         Reviewed by Ryosuke Niwa.
1004
1005         Allow non-string keys in CFDictionary encoding/decoding. Encode the correct
1006         size for dictionaries and arrays when unknown keys or values are skipped.
1007         Allow null array encoding and decoding like dictionary already allowed.
1008
1009         * Shared/cf/ArgumentCodersCF.cpp:
1010         (IPC::encode):
1011         (IPC::decode):
1012
1013 2019-03-28  John Wilander  <wilander@apple.com>
1014
1015         Resource Load Statistics: IPC to the WebsiteDataStore in the UI process from NetworkProcess::deleteWebsiteDataForRegistrableDomains()
1016         https://bugs.webkit.org/show_bug.cgi?id=196281
1017         <rdar://problem/48938748>
1018
1019         Reviewed by Alex Christensen.
1020
1021         The move of Resource Load Statistics to the network process requires that it
1022         calls the UI process when clearing website data (previously the other way
1023         around). This patch achieves that.
1024
1025         Specifically, NetworkProcess::deleteWebsiteDataForRegistrableDomains() now
1026         filters its WebsiteDataTypes down to just the ones applicable for the UI
1027         process and then calls DeleteWebsiteDataInUIProcessForRegistrableDomains over
1028         IPC.
1029
1030         NetworkProcessProxy::deleteWebsiteDataInUIProcessForRegistrableDomains() on
1031         the UI process side makes use of the re-introduced
1032         WebsiteDataStore::fetchDataForRegistrableDomains() function to get the relevant
1033         data records and call WebsiteDataStore::removeData(). The re-introduced
1034         WebsiteDataStore::fetchDataForRegistrableDomains() was removed as dead code in
1035         https://trac.webkit.org/changeset/242056/webkit, then under the name
1036         WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains(). The reason it
1037         was dead code was the lack of IPC call that this patch adds.
1038
1039         * NetworkProcess/NetworkProcess.cpp:
1040         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
1041            Now calls DeleteWebsiteDataInUIProcessForRegistrableDomains over IPC if there
1042            are WebsiteDataTypes applicable to the UI process.
1043         * NetworkProcess/NetworkProcess.h:
1044         * Shared/WebsiteData/WebsiteData.cpp:
1045         (WebKit::WebsiteData::ownerProcess):
1046         (WebKit::WebsiteData::filter):
1047             Convenience functions to manage process ownership of website data types.
1048         * Shared/WebsiteData/WebsiteData.h:
1049         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1050         (WKWebsiteDataStoreStatisticsHasLocalStorage):
1051             Test infrastructure, called by the TestRunner.
1052         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1053         * UIProcess/Network/NetworkProcessProxy.cpp:
1054         (WebKit::NetworkProcessProxy::deleteWebsiteDataInUIProcessForRegistrableDomains):
1055             New function to be called from the network process.
1056         * UIProcess/Network/NetworkProcessProxy.h:
1057         * UIProcess/Network/NetworkProcessProxy.messages.in:
1058         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
1059         (WebKit::WebsiteDataRecord::matches const):
1060             Now matches with WebCore::RegistrableDomain instead of a string.
1061         (WebKit::WebsiteDataRecord::matchesTopPrivatelyControlledDomain const): Deleted.
1062             Replaced by WebsiteDataRecord::matches().
1063         * UIProcess/WebsiteData/WebsiteDataRecord.h:
1064         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1065         (WebKit::WebsiteDataStore::fetchDataForRegistrableDomains):
1066             Re-introduced. It was removed as dead code in r242056.
1067         (WebKit::computeNetworkProcessAccessTypeForDataRemoval):
1068         (WebKit::WebsiteDataStore::hasLocalStorageForTesting const):
1069             Test infrastructure, called by the TestRunner.
1070         * UIProcess/WebsiteData/WebsiteDataStore.h:
1071
1072 2019-03-28  Jiewen Tan  <jiewen_tan@apple.com>
1073
1074         API::Data::createWithoutCopying should do a null check before calling CFRelease
1075         https://bugs.webkit.org/show_bug.cgi?id=196276
1076         <rdar://problem/48059859>
1077
1078         Reviewed by Alex Christensen.
1079
1080         * Shared/Cocoa/APIDataCocoa.mm:
1081         (API::Data::createWithoutCopying):
1082
1083 2019-03-28  Per Arne Vollan  <pvollan@apple.com>
1084
1085         [iOS] Automatic focus of input field is flaky
1086         https://bugs.webkit.org/show_bug.cgi?id=196302
1087
1088         Reviewed by Brent Fulgham.
1089
1090         Sometimes the status of whether a keyboard is connected can be incorrect, both in the UI process, and in
1091         the WebContent process. Fix this by sending the keyboard status to the WebContent process as part of the
1092         Web page creation parameters. Stop caching the keyboard status in the Web process proxy, and call
1093         [UIKeyboard isInHardwareKeyboardMode] instead, since this method is swizzled in the test harness.
1094
1095         * Shared/WebPageCreationParameters.cpp:
1096         (WebKit::WebPageCreationParameters::encode const):
1097         (WebKit::WebPageCreationParameters::decode):
1098         * Shared/WebPageCreationParameters.h:
1099         * UIProcess/API/Cocoa/WKWebView.mm:
1100         (hardwareKeyboardAvailabilityChangedCallback):
1101         * UIProcess/WebPageProxy.cpp:
1102         (WebKit::WebPageProxy::creationParameters):
1103         * UIProcess/WebPageProxy.h:
1104         * UIProcess/WebProcessProxy.cpp:
1105         * UIProcess/WebProcessProxy.h:
1106         (WebKit::WebProcessProxy::setKeyboardIsAttached): Deleted.
1107         (WebKit::WebProcessProxy::keyboardIsAttached const): Deleted.
1108         * UIProcess/ios/WKContentViewInteraction.mm:
1109         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1110         * UIProcess/ios/WebPageProxyIOS.mm:
1111         (WebKit::WebPageProxy::isInHardwareKeyboardMode):
1112         (WebKit::WebPageProxy::applicationWillEnterForeground):
1113         * WebProcess/WebPage/WebPage.cpp:
1114         * WebProcess/WebPage/WebPage.h:
1115
1116 2019-03-28  Tim Horton  <timothy_horton@apple.com>
1117
1118         Fix the build.
1119
1120         * UIProcess/ios/WKActionSheetAssistant.mm:
1121         (-[WKActionSheetAssistant showImageSheet]):
1122         * UIProcess/ios/WKContentViewInteraction.mm:
1123         (-[WKContentView actionSheetAssistant:showCustomSheetForElement:]):
1124
1125 2019-03-28  Michael Catanzaro  <mcatanzaro@igalia.com>
1126
1127         [WPE][GTK] webkit_web_resource_get_data_finish can return NULL without setting error
1128         https://bugs.webkit.org/show_bug.cgi?id=186276
1129
1130         Reviewed by Carlos Garcia Campos.
1131
1132         Currently it's possible for webkit_web_resource_get_data_finish() to return NULL without
1133         setting the error parameter. This is illegal because it is an API guarantee (and a GObject
1134         convention) that if an error parameter exists, it should be set whenever a function call
1135         returns NULL. Epiphany correctly dereferences the error in this case without checking if it
1136         is NULL, because it knows it does not have to, and crashes. Fix this. We'll return a byte
1137         array of length 1 containing a NUL character. This isn't great, but there's not really any
1138         better solution without deprecating the API or returning an error code to indicate an empty
1139         resource, and it at least fixes the Epiphany crash.
1140
1141         This does not fix bug #186276, in which this function incorrectly returns no data when it
1142         ought to. But that is a different bug. Now, at least we won't crash when no data is
1143         available.
1144
1145         * UIProcess/API/glib/WebKitWebResource.cpp:
1146         (resourceDataCallback):
1147
1148 2019-03-28  Daniel Bates  <dabates@apple.com>
1149
1150         [iPad] Tapping on a popup form control may not show a popover
1151         https://bugs.webkit.org/show_bug.cgi?id=196322
1152         <rdar://problem/49229632>
1153
1154         Reviewed by Wenson Hsieh.
1155
1156         Stop taking advantage of -[WKContentView inputView] being called when we invoke -reloadInputViews
1157         to "lazily" allocate the input peripheral for the currently focused element. In theory, UIKit only
1158         needs to call -inputView when it actually needs to display the input view (the keyboard). For
1159         popup menu buttons, like <select>, no keyboard is needed. Instead we should create the peripheral
1160         as part of the logic in the UI process to focus a new element before we call -reloadInputViews.
1161
1162         * UIProcess/ios/WKContentViewInteraction.mm:
1163         (-[WKContentView inputView]): Extract logic to allocate the peripheral from here and moved it to createInputPeripheralWithView().
1164         (-[WKContentView accessoryTab:]): While I am here, add a FIXME comment to explain why we need to
1165         end the input sessions and nullify the input peripheral before we tell the web process to switch
1166         focus as opposed to letting this happen after the web process tells us it focused a new element.
1167         (createInputPeripheralWithView): Added.
1168         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1169         Write in terms of createInputPeripheralWithView(). Create the input peripheral after becoming
1170         first responder because creating the peripheral has known side-effects: for popup buttons it
1171         tells the popup controller to present the popover. For key input to popovers to work from the get-go,
1172         the content view must be the first responder. See <https://bugs.webkit.org/show_bug.cgi?id=196272>
1173         for more details.
1174
1175 2019-03-28  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
1176
1177         Silence lot of warnings when compiling with clang
1178         https://bugs.webkit.org/show_bug.cgi?id=196310
1179
1180         Reviewed by Michael Catanzaro.
1181
1182         * UIProcess/API/glib/WebKitInjectedBundleClient.cpp: add missing
1183         override clause.
1184         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h: add
1185         missing override clause.
1186
1187 2019-03-27  Ryosuke Niwa  <rniwa@webkit.org>
1188
1189         [macOS] Select element doesn't show popup if select element had lost focus while popup was previosuly shown
1190         https://bugs.webkit.org/show_bug.cgi?id=196336
1191
1192         Reviewed by Tim Horton.
1193
1194         The bug was caused by WebPopupMenu::hide never notifying PopupClient that the popup had been dismissed.
1195         This resulted in RenderMenuList::m_popupIsVisible to be never reset.
1196
1197         Also fixed a bug in WebPopupMenuProxyMac::hidePopupMenu that this function was never dismissing
1198         the popup as the selector "dismissPopUp", on the contrary to its name, does not dimiss the popup.
1199         Send cancelTracking to NSMenu instead, which DOES dismiss the popup.
1200
1201         Tests: fast/forms/select/mac-wk2/blur-dismisses-select-popup.html
1202                fast/forms/select/mac-wk2/open-select-popup-after-dismissing-by-blur.html
1203
1204         * UIProcess/mac/WebPopupMenuProxyMac.mm:
1205         (WebKit::WebPopupMenuProxyMac::hidePopupMenu):
1206         * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
1207         (WebKit::WebPopupMenu::hide):
1208
1209 2019-03-27  Dean Jackson  <dino@apple.com>
1210
1211         [ARKit] Black view when opening a 3D model usdz file in new tab
1212         https://bugs.webkit.org/show_bug.cgi?id=196333
1213         <rdar://problem/47693367>
1214
1215         Reviewed by Tim Horton.
1216
1217         When opening a new WKSystemPreviewView, we were exiting if there was no
1218         presentingViewController. This code was unnecessary, and causing blank
1219         content when opening a new tab.
1220
1221         * UIProcess/ios/WKSystemPreviewView.mm:
1222         (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]):
1223         Remove the code looking for a presentingViewController.
1224
1225 2019-03-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1226
1227         Need a way to include WebKitAdditions code in WebKit API headers
1228         https://bugs.webkit.org/show_bug.cgi?id=196173
1229
1230         Reviewed by Tim Horton.
1231
1232         Introduce a mechanism that allows us to insert code from WebKitAdditions into public or private SDK headers
1233         using `#import`s of the form:
1234
1235         ```
1236         #if USE(APPLE_INTERNAL_SDK)
1237         #import <WebKitAdditions/WKWebViewConfigurationAdditions.h>
1238         #endif
1239         ```
1240
1241         The resulting header in the built products directory will contain the contents of the imported file inserted in
1242         place of the `#if USE(APPLE_INTERNAL_SDK) … #endif` block; however, when building with the Apple internal SDK,
1243         the additions header content will be imported by the usual means.
1244
1245         * mac/postprocess-framework-headers.sh:
1246         * mac/replace-webkit-additions-includes.py: Added.
1247
1248         Add a step when post-processing framework headers to replace instances of `#if USE(APPLE_INTERNAL_SDK) … #endif`
1249         with the text content of the additions files. The replacement script first searches in the built products
1250         directory for the matching additions file, and falls back to the SDK if no matching file is found. If neither
1251         are present (e.g. a build using the public SDK), then the block is simply replaced by the empty string.
1252
1253         (read_content_from_webkit_additions):
1254         (main):
1255
1256 2019-03-27  Andy Estes  <aestes@apple.com>
1257
1258         REGRESSION (r242686): package-root creates roots with broken symlinks in WebKit.framework/XPCServices/
1259         https://bugs.webkit.org/show_bug.cgi?id=196317
1260
1261         Reviewed by Dan Bernstein.
1262
1263         Removed some remnants of the Storage Process.
1264
1265         * Configurations/BaseTarget.xcconfig:
1266         * Resources/SandboxProfiles/ios/com.apple.WebKit.Storage.sb: Removed.
1267         * WebKit.xcodeproj/project.pbxproj:
1268
1269 2019-03-27  Keith Rollin  <krollin@apple.com>
1270
1271         Include the CFNetworking task UUID to the NSError when a resource-load fails
1272         https://bugs.webkit.org/show_bug.cgi?id=196156
1273
1274         Reviewed by Alex Christensen.
1275
1276         In order to help track the connection between a failed resource-load
1277         and a user-visible error message, include the CFNetworking task UUID
1278         in the associated error as an element of the userInfo property. This
1279         can then be pulled out and reported in the logging at the point the
1280         error is reported to the user.
1281
1282         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1283         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
1284
1285 2019-03-27  Chris Dumez  <cdumez@apple.com>
1286
1287         [ iOS Sim ] REGRESSION (r242277) Layout Test http/tests/cookies/same-site/lax-samesite-cookie-after-cross-site-history-load.php is a flaky timeout
1288         https://bugs.webkit.org/show_bug.cgi?id=195425
1289         <rdar://problem/48682403>
1290
1291         Reviewed by Alex Christensen.
1292
1293         When process-swapping on history navigation, we lookup the WebProcessProxy we'd like to use from the
1294         process identifier that is saved on the WebBackForwardListItem, to try and load the item in the process
1295         in which it was previously loaded. However, we were failing to check if the WebProcess in question was
1296         still running so we could potentially try to use a process that's already exited.
1297
1298         * UIProcess/WebProcessPool.cpp:
1299         (WebKit::WebProcessPool::processForNavigationInternal):
1300
1301 2019-03-27  Zalan Bujtas  <zalan@apple.com>
1302
1303         [ContentChangeObserver] Always dispatch the synthetic click asynchronously
1304         https://bugs.webkit.org/show_bug.cgi?id=196278
1305         <rdar://problem/49299968>
1306
1307         Reviewed by Simon Fraser.
1308
1309         This patch ensures that all completeSyntheticClick() calls happen in an asynchronous manner (unless the feature is turned off).
1310
1311         * WebProcess/WebPage/ios/WebPageIOS.mm:
1312         (WebKit::dispatchSyntheticMouseMove):
1313         (WebKit::WebPage::handleSyntheticClick):
1314
1315 2019-03-27  Tim Horton  <timothy_horton@apple.com>
1316
1317         Fix some more deprecation warnings in WKDrawingView
1318         https://bugs.webkit.org/show_bug.cgi?id=196282
1319         <rdar://problem/47637608>
1320
1321         Reviewed by Wenson Hsieh.
1322
1323         * Platform/spi/ios/PencilKitSPI.h:
1324         * SourcesCocoa.txt:
1325         * UIProcess/ios/PencilKitSoftLink.h:
1326         * UIProcess/ios/PencilKitSoftLink.mm:
1327         * UIProcess/ios/WKContentViewInteraction.mm:
1328         * UIProcess/ios/WKDrawingCoordinator.h:
1329         * UIProcess/ios/WKDrawingCoordinator.mm:
1330         (-[WKDrawingCoordinator initWithContentView:]):
1331         (-[WKDrawingCoordinator currentInk]):
1332         (-[WKDrawingCoordinator undoManagerForInkPicker:]):
1333         (-[WKDrawingCoordinator containingViewForInkPicker:]):
1334         (-[WKDrawingCoordinator inkPickerDidToggleRuler:]):
1335         (-[WKDrawingCoordinator inkPickerDidChangeInk:]):
1336         (-[WKDrawingCoordinator installInkPickerForDrawing:]):
1337         (-[WKDrawingCoordinator uninstallInkPicker]):
1338         (-[WKDrawingCoordinator inkPicker]): Deleted.
1339         (-[WKDrawingCoordinator didChangeRulerState:]): Deleted.
1340         (-[WKDrawingCoordinator didChangeInk:]): Deleted.
1341         * UIProcess/ios/WKDrawingView.mm:
1342         (-[WKDrawingView _canvasViewWillBeginDrawing:]):
1343         * UIProcess/ios/WKInkPickerView.h: Removed.
1344         * UIProcess/ios/WKInkPickerView.mm: Removed.
1345         * WebKit.xcodeproj/project.pbxproj:
1346         Adopt the new names.
1347
1348 2019-03-27  Carlos Garcia Campos  <cgarcia@igalia.com>
1349
1350         Geolocation request not complete when watch request was started in a different web process
1351         https://bugs.webkit.org/show_bug.cgi?id=195996
1352
1353         Reviewed by Alex Christensen.
1354
1355         In WebGeolocationManagerProxy::startUpdating() we do nothing when the provider is already updating. We should
1356         reply with a DidChangePosition using the last known position, if available. If we are updating, but we still
1357         don't have a known position, the request will be completed when
1358         WebGeolocationManagerProxy::providerDidChangePosition() is called since it always notifies all web
1359         processes.
1360
1361         * UIProcess/WebGeolocationManagerProxy.cpp:
1362         (WebKit::WebGeolocationManagerProxy::providerDidChangePosition): Cache the position.
1363         (WebKit::WebGeolocationManagerProxy::startUpdating): Reply using cached position if already known.
1364         * UIProcess/WebGeolocationManagerProxy.h:
1365         (WebKit::WebGeolocationManagerProxy::lastPosition const): Return cached position.
1366         * WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
1367         (WebKit::WebGeolocationClient::lastPosition): Remove the FIXME since we don't want this feature.
1368
1369 2019-03-26  Brent Fulgham  <bfulgham@apple.com>
1370
1371         [macOS] Correct kerberos-related sandbox violations
1372         https://bugs.webkit.org/show_bug.cgi?id=196279
1373         <rdar://problem/48622502>
1374
1375         Reviewed by Per Arne Vollan.
1376
1377         We need to allow communications with a Kerberos-related service on macOS
1378         until <rdar://problem/35542803> is fixed.
1379
1380         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1381
1382 2019-03-26  Chris Dumez  <cdumez@apple.com>
1383
1384         [macOS] The network process is not exiting reliably when the WebProcessPool is destroyed
1385         https://bugs.webkit.org/show_bug.cgi?id=196277
1386         <rdar://problem/49127581>
1387
1388         Reviewed by Alex Christensen.
1389
1390         When, an AuxiliaryProcess receives the AuxiliaryProcess::Terminate IPC, it calls stopRunLoop()
1391         to exit. WebProcess overrides AuxiliaryProcess::stopRunLoop() to call exit(0) on the main
1392         thread. Other auxiliary processes such as the NetworkProcess would end up calling
1393         platformStopRunLoop(). On iOS and iOSMac, platformStopRunLoop() calls XPCServiceExit(), which
1394         makes sense since auxiliary processes run their run loop by calling xpc_main(). However, on
1395         macOS, platformStopRunLoop() was calling RunLoop::main().stop() to exit instead, which was
1396         unreliable as demonstrated by the test app attached to the radar.
1397
1398         Updating platformStopRunLoop() to call XPCServiceExit() on macOS fixes the problem and I now
1399         see the NetworkProcess exiting reliably there. This is the approach I have chosen in this
1400         patch since it appears to be reliable and it makes the code consistent on all Cocoa platforms.
1401
1402         * Shared/AuxiliaryProcess.cpp:
1403         * Shared/Cocoa/AuxiliaryProcessCocoa.mm:
1404         (WebKit::AuxiliaryProcess::platformStopRunLoop):
1405         * Shared/ios/AuxiliaryProcessIOS.mm:
1406         (WebKit::AuxiliaryProcess::platformStopRunLoop): Deleted.
1407         * Shared/mac/AuxiliaryProcessMac.mm:
1408         (WebKit::AuxiliaryProcess::platformStopRunLoop): Deleted.
1409
1410 2019-03-26  Keith Rollin  <krollin@apple.com>
1411
1412         Inhibit CFNetwork logging in private sessions
1413         https://bugs.webkit.org/show_bug.cgi?id=196268
1414         <rdar://problem/48210793>
1415
1416         Reviewed by Alex Christensen.
1417
1418         Before performing any logging, the NetworkProcess checks to see if
1419         it's performing an operation associated with a private (ephemeral)
1420         browsing session. If so, it skips the logging. However, networking
1421         layers below the NetworkProcess don't know about private browsing, so
1422         they would still perform their own logging. CFNetwork now has a flag
1423         that lets us control that, so set it to False if private browsing.
1424
1425         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1426         (WebKit::configurationForSessionID):
1427
1428 2019-03-26  Chris Dumez  <cdumez@apple.com>
1429
1430         Add basic layout test coverage for File Picker on iOS
1431         https://bugs.webkit.org/show_bug.cgi?id=196265
1432
1433         Reviewed by Wenson Hsieh.
1434
1435         Add layout test infrastructure to test the file picker on iOS.
1436
1437         * UIProcess/API/Cocoa/WKWebView.mm:
1438         (-[WKWebView _dismissFilePicker]):
1439         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1440         * UIProcess/ios/WKContentViewInteraction.h:
1441         * UIProcess/ios/WKContentViewInteraction.mm:
1442         (-[WKContentView dismissFilePicker]):
1443         (-[WKContentView _contentsOfUserInterfaceItem:]):
1444         * UIProcess/ios/forms/WKFileUploadPanel.h:
1445         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1446         (-[WKFileUploadPanel currentAvailableActionTitles]):
1447
1448 2019-03-26  Daniel Bates  <dabates@apple.com>
1449
1450         [iOS][WK2] Use a better concept to describe the reason we defer zooming a focused element: selectabiltiy
1451         https://bugs.webkit.org/show_bug.cgi?id=196264
1452
1453         Reviewed by Wenson Hsieh.
1454
1455         Rename shouldDeferZoomingToSelectionWhenRevealingFocusedElement() to mayContainSelectableText() to describe
1456         the criterion that we will use to decide whether to defer zooming or not. We defer zooming only for elements
1457         that may support text selection on initial focus because we do not have an up-to-date selection rect at that
1458         time. For element, like <select>, that do not support text selection, we can zoom them immediately when focused.
1459
1460         * UIProcess/ios/WKContentViewInteraction.mm:
1461         (mayContainSelectableText): Renamed from shouldDeferZoomingToSelectionWhenRevealingFocusedElement.
1462         List all the input types in the switch block and remove the default case to force the compiler to check that we
1463         covered all cases. This will prevent unforseen keyboard issues (why isn't the keyboard shown? or why is the keyboard shown?)
1464         for future input types that we may add.
1465         (rectToRevealWhenZoomingToFocusedElement): Update for renaming.
1466         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]): Add a
1467         comment to explain why we may need to defer the zoom: the focused element supports text selection and we need
1468         to wait for the web process to call back to provide an up-to-date selection rect for us to zoom and reveal.
1469         (-[WKContentView _didReceiveEditorStateUpdateAfterFocus]): Update for renaming.
1470         (shouldDeferZoomingToSelectionWhenRevealingFocusedElement): Deleted.
1471
1472 2019-03-26  Wenson Hsieh  <wenson_hsieh@apple.com>
1473
1474         Implement async paste method on UIWKInteractionViewProtocol
1475         https://bugs.webkit.org/show_bug.cgi?id=196267
1476         <rdar://problem/49236346>
1477
1478         Reviewed by Tim Horton.
1479
1480         Implement a new UIWKInteractionViewProtocol hook to perform a paste command, and invoke the given completion
1481         handler when pasting is finished.
1482
1483         Test: UIPasteboardTests.PasteWithCompletionHandler
1484
1485         * UIProcess/ios/WKContentViewInteraction.mm:
1486         (-[WKContentView pasteWithCompletionHandler:]):
1487
1488 2019-03-26  Per Arne Vollan  <pvollan@apple.com>
1489
1490         [macOS] Fix sandbox violations
1491         https://bugs.webkit.org/show_bug.cgi?id=196262
1492         <rdar://problem/47738015>
1493
1494         Reviewed by Brent Fulgham.
1495
1496         Fix various observed sandbox violations.
1497
1498         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1499         * WebProcess/com.apple.WebProcess.sb.in:
1500
1501 2019-03-26  Tomoki Imai  <Tomoki.Imai@sony.com>
1502
1503         Assertion failure !isInAcceleratedCompositingMode() in DrawingAreaProxyCoordinatedGraphics::incorporateUpdate when forceCompositingMode is turned on
1504         https://bugs.webkit.org/show_bug.cgi?id=195879
1505
1506         Reviewed by Carlos Garcia Campos.
1507
1508         The root cause is that DrawingAreaProxyCoordinatedGraphics::isInAcceleratedCompositingMode checks both of alwaysUseCompositing() and !m_layerTreeContext.isEmpty().
1509         alwaysUseCompositing() refers preferences, which is written by the application (UIProcess).
1510         On the other hand, m_layerTreeContext is changed when it receives enterAcceleratedCompositingMode/exitAcceleratedCompositingMode from WebProcess.
1511
1512         It results when we set forceCompositingMode and acceleratedCompositingEnabled to true, WebProcess and UIProcess is out of sync until WebProcess sends enterAcceleratedCompositingMode message.
1513         In such situation, WebProcess sends incorporateUpdate to UIProcess because WebProcess is in non-AC mode, but isInAcceleratedCompositingMode becomes true in UIProcess side.
1514
1515         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
1516         (WebKit::DrawingAreaProxyCoordinatedGraphics::~DrawingAreaProxyCoordinatedGraphics): Should call exitAcceleratedCompositingMode even when alwaysUseCompositing is true.
1517         (WebKit::DrawingAreaProxyCoordinatedGraphics::enterAcceleratedCompositingMode): enterAcceleratedCompositingMode should check enterAcceleratedCompositingMode is not called twice.
1518         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h: Remove alwaysUseCompositing from isInAcceleratedCompositingMode
1519
1520 2019-03-26  Antoine Quint  <graouts@apple.com>
1521
1522         Remove mousemoveEventHandlingPreventsDefault internal setting and quirk
1523         https://bugs.webkit.org/show_bug.cgi?id=196254
1524         <rdar://problem/49124334>
1525
1526         Reviewed by Dean Jackson.
1527
1528         * Shared/WebPreferences.yaml:
1529
1530 2019-03-26  Philippe Normand  <pnormand@igalia.com>
1531
1532         [WPE][Qt] Uninitialized racy ViewBackend
1533         https://bugs.webkit.org/show_bug.cgi?id=196247
1534
1535         Reviewed by Carlos Garcia Campos.
1536
1537         * UIProcess/API/wpe/qt/WPEQtView.h: Initialize the backend pointer to nullptr.
1538
1539 2019-03-26  Carlos Garcia Campos  <cgarcia@igalia.com>
1540
1541         Unreviewed. Fix typo in GLib geolocation API after r243285.
1542
1543         gelocation -> geolocation.
1544
1545         * UIProcess/API/glib/WebKitGeolocationManager.cpp:
1546         (webkit_geolocation_manager_class_init):
1547         (webkit_geolocation_manager_update_position):
1548         (webkit_geolocation_manager_failed):
1549         (webkit_gelocation_manager_update_position): Deleted.
1550         (webkit_gelocation_manager_failed): Deleted.
1551         * UIProcess/API/gtk/WebKitGeolocationManager.h:
1552         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1553         * UIProcess/API/wpe/WebKitGeolocationManager.h:
1554         * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:
1555
1556 2019-03-26  Patrick Griffis  <pgriffis@igalia.com>
1557
1558         [GTK][WPE] Disable process warming
1559         https://bugs.webkit.org/show_bug.cgi?id=196208
1560
1561         Reviewed by Chris Dumez.
1562
1563         Fixes crash caused by r243384.
1564
1565         Process warming is incompatible with our launcher as it expects a valid
1566         WebsiteDataStore at initialization time for sandbox permissions.
1567
1568         * UIProcess/glib/WebProcessPoolGLib.cpp:
1569         (WebKit::WebProcessPool::platformInitialize):
1570
1571 2019-03-25  Alex Christensen  <achristensen@webkit.org>
1572
1573         Do not terminate the NetworkProcess if a third party application sends a NSCredential with a SecIdentityRef
1574         https://bugs.webkit.org/show_bug.cgi?id=196213
1575
1576         Reviewed by Geoff Garen.
1577
1578         A release assertion added in r230225 was reachable.  I reached it in a unit test that responds to a challenge
1579         with a SecIdentityRef wrapped in an NSCredential.
1580
1581         * Shared/cf/ArgumentCodersCF.cpp:
1582         (IPC::decode):
1583
1584 2019-03-25  Chris Dumez  <cdumez@apple.com>
1585
1586         Regression(r242369) Trying to change profile picture on linked in shows file picker, not the image picker
1587         https://bugs.webkit.org/show_bug.cgi?id=196205
1588         <rdar://problem/49083324>
1589
1590         Reviewed by Geoffrey Garen.
1591
1592         Update our FileUploadPanel code on iOS to properly deal with the MIME types containing
1593         wild cards (e.g. "image/*") that are defined in the HTML specification:
1594         - https://html.spec.whatwg.org/multipage/input.html#attr-input-accept
1595
1596         Previously, we would fail to convert those to UTIs.
1597
1598         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1599
1600 2019-03-25  Tim Horton  <timothy_horton@apple.com>
1601
1602         Remove some now-unnecessary dynamic class lookup
1603         https://bugs.webkit.org/show_bug.cgi?id=196237
1604
1605         Reviewed by Simon Fraser.
1606
1607         * Shared/DocumentEditingContext.mm:
1608         (WebKit::DocumentEditingContext::toPlatformContext):
1609
1610 2019-03-25  Tim Horton  <timothy_horton@apple.com>
1611
1612         Get rid of ENABLE(ANIMATED_KEYBOARD_SCROLLING)
1613         https://bugs.webkit.org/show_bug.cgi?id=196224
1614
1615         Reviewed by Simon Fraser.
1616
1617         * Platform/spi/ios/AccessibilitySupportSPI.h:
1618         * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
1619         (-[WKKeyboardScrollingAnimator invalidate]):
1620         (perpendicularAbsoluteUnitVector):
1621         (-[WKKeyboardScrollingAnimator beginWithEvent:]):
1622         (-[WKKeyboardScrollingAnimator stopAnimatedScroll]):
1623         (-[WKKeyboardScrollingAnimator willStartInteractiveScroll]):
1624         (-[WKKeyboardScrollViewAnimator scrollToContentOffset:animated:]):
1625         (-[WKKeyboardScrollViewAnimator scrollWithScrollToExtentAnimationTo:]):
1626         (-[WKKeyboardScrollingAnimator startRepeatTimerIfNeeded]): Deleted.
1627         (-[WKKeyboardScrollingAnimator stopRepeatTimer]): Deleted.
1628         (-[WKKeyboardScrollingAnimator performDiscreteScroll]): Deleted.
1629
1630 2019-03-25  Fujii Hironori  <Hironori.Fujii@sony.com>
1631
1632         Enable IPC sending and receiving non-default-constructible types
1633         https://bugs.webkit.org/show_bug.cgi?id=196132
1634         <rdar://problem/49229221>
1635
1636         Unreviewed build fix for WinCairo port.
1637
1638         error C2440: '=': cannot convert from 'int' to 'HANDLE'
1639
1640         * Platform/win/SharedMemoryWin.cpp:
1641         (WebKit::SharedMemory::Handle::Handle): std::exchange HANDLE with nullptr, not 0.
1642         (WebKit::SharedMemory::Handle::operator=): Ditto.
1643
1644 2019-03-25  Fujii Hironori  <Hironori.Fujii@sony.com>
1645
1646         [Coordinated Graphics][WinCairo] ASSERTION FAILED: state.id == m_nicosia.state.id
1647         https://bugs.webkit.org/show_bug.cgi?id=196190
1648
1649         Reviewed by Žan Doberšek.
1650
1651         This assertion assumes the pre-committed and the committed scenes
1652         are identical. But, the pre-committed scene is updated in the main
1653         thread. Removed the false assertion.
1654
1655         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1656         (WebKit::CoordinatedGraphicsScene::purgeGLResources): Remove the
1657         assertion. Removed layers of committed scene, not pre-committed
1658         scene.
1659
1660 2019-03-25  Brady Eidson  <beidson@apple.com>
1661
1662         Add socket-delegate to another entitlements config
1663         rdar://problem/48090350 and https://bugs.webkit.org/show_bug.cgi?id=196227
1664
1665         Reviewed by Geoffrey Garen.
1666
1667         * Configurations/Network-iOSMac.entitlements:
1668
1669 2019-03-25  Commit Queue  <commit-queue@webkit.org>
1670
1671         Unreviewed, rolling out r243465.
1672         https://bugs.webkit.org/show_bug.cgi?id=196226
1673
1674         the test doesn't build (Requested by thorton on #webkit).
1675
1676         Reverted changeset:
1677
1678         "Do not terminate the NetworkProcess if a third party
1679         application sends a NSCredential with a SecIdentityRef"
1680         https://bugs.webkit.org/show_bug.cgi?id=196213
1681         https://trac.webkit.org/changeset/243465
1682
1683 2019-03-25  Simon Fraser  <simon.fraser@apple.com>
1684
1685         REGRESSION (r242687): Flicker when pinch-zooming pages in macOS Safari
1686         https://bugs.webkit.org/show_bug.cgi?id=196126
1687         rdar://problem/49095791
1688
1689         Reviewed by Tim Horton.
1690         
1691         I fumbled the commit after the enum rename. Make this actually work.
1692
1693         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1694         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
1695
1696 2019-03-25  Simon Fraser  <simon.fraser@apple.com>
1697
1698         Zoom on macOS is centered around a point lower than the cursor
1699         https://bugs.webkit.org/show_bug.cgi?id=196225
1700         rdar://problem/49213574
1701
1702         Reviewed by Tim Horton.
1703         
1704         The origin handed to ViewGestureController::handleMagnificationGestureEvent is in WKWebView
1705         coordinates, but we end up setting the transform on the RenderView's layer, so we need
1706         to subtract the topContentInset.
1707
1708         * UIProcess/mac/ViewGestureControllerMac.mm:
1709         (WebKit::ViewGestureController::handleMagnificationGestureEvent):
1710
1711 2019-03-25  Alex Christensen  <achristensen@webkit.org>
1712
1713         Do not terminate the NetworkProcess if a third party application sends a NSCredential with a SecIdentityRef
1714         https://bugs.webkit.org/show_bug.cgi?id=196213
1715
1716         Reviewed by Geoff Garen.
1717
1718         A release assertion added in r230225 was reachable.  I reached it in a unit test that responds to a challenge
1719         with a SecIdentityRef wrapped in an NSCredential.
1720
1721         * Shared/cf/ArgumentCodersCF.cpp:
1722         (IPC::decode):
1723
1724 2019-03-25  Chris Dumez  <cdumez@apple.com>
1725
1726         Get rid of WebPage::m_shouldResetDrawingAreaAfterSuspend flag
1727         https://bugs.webkit.org/show_bug.cgi?id=196210
1728         <rdar://problem/48681326>
1729
1730         Reviewed by Geoffrey Garen.
1731
1732         Get rid of WebPage::m_shouldResetDrawingAreaAfterSuspend flag and use the drawing area identifier
1733         instead to reset the DrawingArea in the WebProcess whenever the UIProcess did.
1734
1735         This is less error-prone and guarantees that the WebProcess and the UIProcess can reliably
1736         communicate via DrawingArea IPC.
1737
1738         * WebProcess/WebPage/WebPage.cpp:
1739         (WebKit::WebPage::reinitializeWebPage):
1740         (WebKit::WebPage::setIsSuspended):
1741         * WebProcess/WebPage/WebPage.h:
1742
1743 2019-03-25  Alex Christensen  <achristensen@webkit.org>
1744
1745         Enable IPC sending and receiving non-default-constructible types
1746         https://bugs.webkit.org/show_bug.cgi?id=196132
1747
1748         Reviewed by Geoff Garen.
1749
1750         * Platform/IPC/ArgumentCoder.h:
1751         * Platform/IPC/ArgumentCoders.h:
1752         (IPC::TupleEncoder::encode):
1753         (IPC::tupleFromTupleAndObject):
1754         (IPC::TupleDecoderImpl::decode):
1755         (IPC::TupleDecoderImpl<Type>::decode):
1756         (IPC::TupleDecoder::decode):
1757         (IPC::TupleDecoder<0>::decode):
1758         (IPC::TupleCoder::encode): Deleted.
1759         (IPC::TupleCoder::decode): Deleted.
1760         * Platform/IPC/Connection.h:
1761         (IPC::Connection::sendWithReply):
1762         (IPC::TupleMover::move):
1763         (IPC::moveTuple):
1764         (IPC::Connection::sendSync):
1765         * Platform/IPC/Decoder.h:
1766         (IPC::Decoder::decode):
1767         (IPC::Decoder::operator>>):
1768         * Platform/IPC/HandleMessage.h:
1769         (IPC::handleMessage):
1770         (IPC::handleMessageSynchronous):
1771         (IPC::handleMessageSynchronousWantsConnection):
1772         (IPC::handleMessageAsync):
1773         * Platform/SharedMemory.h:
1774         * Scripts/webkit/LegacyMessages-expected.h:
1775         * Scripts/webkit/Messages-expected.h:
1776         * Scripts/webkit/MessagesSuperclass-expected.h:
1777         * Scripts/webkit/messages.py:
1778         * Shared/Databases/IndexedDB/WebIDBResult.h:
1779         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
1780         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
1781         * Shared/ShareableBitmap.h:
1782         * Shared/ShareableResource.h:
1783         * Shared/UpdateInfo.h:
1784         * Shared/WebEvent.h:
1785         * Shared/WebProcessCreationParameters.cpp:
1786         * Shared/WebProcessCreationParameters.h:
1787         * Shared/mac/SecItemResponseData.cpp:
1788         (WebKit::SecItemResponseData::SecItemResponseData):
1789         (WebKit::SecItemResponseData::decode):
1790         * Shared/mac/SecItemResponseData.h:
1791         * WebProcess/MediaStream/MediaDeviceSandboxExtensions.h:
1792
1793 2019-03-25  Tim Horton  <timothy_horton@apple.com>
1794
1795         Animated keyboard scrolling is extremely chaotic
1796         https://bugs.webkit.org/show_bug.cgi?id=196164
1797         <rdar://problem/48702444>
1798
1799         Reviewed by Simon Fraser.
1800
1801         * UIProcess/ios/WKContentViewInteraction.mm:
1802         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
1803         Consume keyboard events instead of interpreting them traditionally
1804         if WKKeyboardScrollingAnimator is animating.
1805
1806         * UIProcess/ios/WKKeyboardScrollingAnimator.h:
1807         * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
1808         (-[WKKeyboardScrollingAnimator beginWithEvent:]):
1809         (-[WKKeyboardScrollingAnimator handleKeyEvent:]):
1810         (-[WKKeyboardScrollingAnimator stopAnimatedScroll]):
1811         (-[WKKeyboardScrollingAnimator scrollTriggeringKeyIsPressed]):
1812         (-[WKKeyboardScrollingAnimator displayLinkFired:]):
1813         (-[WKKeyboardScrollViewAnimator scrollTriggeringKeyIsPressed]):
1814         Expose the current state of interactive scrolling, and rename the related member.
1815
1816 2019-03-25  Keith Rollin  <krollin@apple.com>
1817
1818         Add WebKit logging for first paint and other interesting layout milestones
1819         https://bugs.webkit.org/show_bug.cgi?id=196159
1820         <rdar://problem/49128952>
1821
1822         Reviewed by Simon Fraser.
1823
1824         Add some logging to indicate what layout milestones have been reached.
1825         This should help us determine if there's a client, rendering, layout,
1826         or some other issue when page content does not appear in the client
1827         window.
1828
1829         The logging is being added to
1830         WebFrameLoaderClient::dispatchDidReachLayoutMilestone. This seems like
1831         a nice central place to capture layout milestones. However, it will
1832         only log notifications that are being sent to clients. It does not
1833         indicate all milestones that have occurred. That is, it does not
1834         report milestones that are filtered out due to client disinterest.
1835         There doesn't seem to be a good central place to capture all
1836         milestones, regardless of client interest.
1837
1838         * Platform/Logging.h:
1839         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1840         (WebKit::WebFrameLoaderClient::dispatchDidReachLayoutMilestone):
1841
1842 2019-03-25  Patrick Griffis  <pgriffis@igalia.com>
1843
1844         [GTK][WPE] Remove network access from web process sandbox
1845         https://bugs.webkit.org/show_bug.cgi?id=189967
1846
1847         Reviewed by Michael Catanzaro.
1848
1849         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
1850         (WebKit::createFlatpakInfo):
1851         (WebKit::bubblewrapSpawn):
1852         * UIProcess/Launcher/glib/FlatpakLauncher.cpp:
1853         (WebKit::flatpakSpawn):
1854
1855 2019-03-25  Andy Estes  <aestes@apple.com>
1856
1857         [Apple Pay] Call +canMakePayments on a work queue
1858         https://bugs.webkit.org/show_bug.cgi?id=196179
1859         <rdar://problem/45388749>
1860
1861         Reviewed by Brady Eidson.
1862
1863         Calling +canMakePayments on either PKPaymentAuthorizationController or
1864         PKPaymentAuthorizationViewController results in synchronous IPC and is therefore very
1865         expensive to call on the main thread. On iOS, these calls are made in the network process,
1866         and on Mac in the UI process.
1867
1868         Call these methods on a work queue to avoid main thread spins.
1869
1870         * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
1871         (WebKit::WebPaymentCoordinatorProxy::canMakePayments):
1872         * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
1873         * Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
1874         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
1875         * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
1876         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
1877
1878 2019-03-25  Andy Estes  <aestes@apple.com>
1879
1880         [Apple Pay] Remove the AvailablePaymentNetworks synchronous message
1881         https://bugs.webkit.org/show_bug.cgi?id=196180
1882
1883         Reviewed by Youenn Fablet.
1884
1885         Unlike many PassKit interactions, it's ok to call +[PKPaymentRequest availableNetworks]
1886         without an entitlement. Therefore, we can call it from the web process directly rather than
1887         synchronously messaging the entitled UI or networking process.
1888
1889         * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
1890         * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
1891         * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in:
1892         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1893         * SourcesCocoa.txt:
1894         * WebKit.xcodeproj/project.pbxproj:
1895         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
1896         (WebKit::WebPaymentCoordinator::availablePaymentNetworks):
1897         * WebProcess/ApplePay/WebPaymentCoordinator.h:
1898         * WebProcess/ApplePay/cocoa/WebPaymentCoordinatorCocoa.mm: Added.
1899         (WebKit::WebPaymentCoordinator::platformAvailablePaymentNetworks const):
1900         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
1901         (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
1902         (-[WKAccessibilityWebPageObjectBase setWebPage:]):
1903
1904 2019-03-25  Chris Dumez  <cdumez@apple.com>
1905
1906         Unreviewed, tiny fix after r243388 to address API test failures on iOS
1907
1908         m_processType was properly initialized on macOS but not iOS.
1909
1910         * WebProcess/cocoa/WebProcessCocoa.mm:
1911         (WebKit::WebProcess::platformInitializeProcess):
1912
1913 2019-03-25  Carlos Garcia Campos  <cgarcia@igalia.com>
1914
1915         [GTK][WPE] Do not allow changes in active URI before provisional load starts for non-API requests
1916         https://bugs.webkit.org/show_bug.cgi?id=194208
1917
1918         Reviewed by Michael Catanzaro.
1919
1920         * UIProcess/API/glib/WebKitWebView.cpp:
1921         (webkitWebViewWillStartLoad): Block updates of active URL.
1922         (webkitWebViewLoadChanged): Unblock updates of active URL on WEBKIT_LOAD_STARTED.
1923
1924 2019-03-25  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1925
1926         Remove NavigatorContentUtils in WebCore/Modules
1927         https://bugs.webkit.org/show_bug.cgi?id=196070
1928
1929         Reviewed by Alex Christensen.
1930
1931         NavigatorContentUtils was to support the custom scheme spec [1].
1932         However, in WebKit side, no port has supported the feature in
1933         WebKit layer after EFL port was removed. So there has been the
1934         only IDL implementation of the NavigatorContentUtils in WebCore.
1935         So we don't need to keep the implementation in WebCore anymore.
1936
1937         [1] https://html.spec.whatwg.org/multipage/system-state.html#custom-handlers
1938
1939         * Configurations/FeatureDefines.xcconfig:
1940         * WebProcess/WebCoreSupport/WebNavigatorContentUtilsClient.h: Removed.
1941
1942 2019-03-24  Zan Dobersek  <zdobersek@igalia.com>
1943
1944         Unreviewed WPE build fix.
1945
1946         * UIProcess/wpe/WebPasteboardProxyWPE.cpp:
1947         Add an explicit CompletionHandler.h include to avoid a trip-up in
1948         unified builds.
1949
1950 2019-03-24  Fujii Hironori  <Hironori.Fujii@sony.com>
1951
1952         [WinCairo] WebProcessDataStoreParameters.h(32): error C2653: 'SandboxExtension': is not a class or namespace name
1953         https://bugs.webkit.org/show_bug.cgi?id=196192
1954
1955         Unreviewed for WinCairo port.
1956
1957         * Shared/WebProcessDataStoreParameters.h: Added #include "SandboxExtension.h".
1958
1959 2019-03-24  Andy Estes  <aestes@apple.com>
1960
1961         [watchOS] Remove unused Proximity Networking code
1962         https://bugs.webkit.org/show_bug.cgi?id=196188
1963
1964         Reviewed by Tim Horton.
1965
1966         * Configurations/WebKit.xcconfig:
1967         * NetworkProcess/NetworkProcess.cpp:
1968         (WebKit::NetworkProcess::NetworkProcess):
1969         * NetworkProcess/NetworkProcess.h:
1970         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1971         (WebKit::NetworkProcessCreationParameters::encode const):
1972         (WebKit::NetworkProcessCreationParameters::decode):
1973         * NetworkProcess/NetworkProcessCreationParameters.h:
1974         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
1975         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1976         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
1977         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1978         (WebKit::NetworkProcess::platformPrepareToSuspend):
1979         (WebKit::NetworkProcess::platformProcessDidResume):
1980         (WebKit::NetworkProcess::platformProcessDidTransitionToBackground):
1981         (WebKit::NetworkProcess::platformProcessDidTransitionToForeground):
1982         * NetworkProcess/watchos/NetworkProximityAssertion.h: Removed.
1983         * NetworkProcess/watchos/NetworkProximityAssertion.mm: Removed.
1984         * NetworkProcess/watchos/NetworkProximityManager.h: Removed.
1985         * NetworkProcess/watchos/NetworkProximityManager.mm: Removed.
1986         * SourcesCocoa.txt:
1987         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1988         (API::ProcessPoolConfiguration::copy):
1989         * UIProcess/API/APIProcessPoolConfiguration.h:
1990         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
1991         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
1992         (-[_WKProcessPoolConfiguration wirelessContextIdentifier]):
1993         (-[_WKProcessPoolConfiguration setWirelessContextIdentifier:]):
1994         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1995         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1996         * WebKit.xcodeproj/project.pbxproj:
1997
1998 2019-03-23  Chris Dumez  <cdumez@apple.com>
1999
2000         Unreviewed, fix typo in comment added in r243379.
2001
2002         * UIProcess/API/Cocoa/WKProcessGroup.mm:
2003         (-[WKProcessGroup setDelegate:]):
2004
2005 2019-03-23  Simon Fraser  <simon.fraser@apple.com>
2006
2007         REGRESSION (iOS 8): Scrollbar can't be hidden when webkit-overflow-scrolling is set to touch
2008         https://bugs.webkit.org/show_bug.cgi?id=137043
2009         rdar://problem/16595330
2010
2011         Reviewed by Zalan Bujtas.
2012
2013         Plumb horizontalScrollbarHiddenByStyle/verticalScrollbarHiddenByStyle through ScrollableAreaParameters
2014         to the UI process, and use it to set UIScrollView indicators visible or not.
2015         
2016         The scroll snap changes in ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren() fix a bug
2017         where hasChangedProperty(HorizontalSnapOffsets) was nested inside another set of hasChangedProperty()
2018         tests, so would never get called.
2019
2020         * Shared/WebCoreArgumentCoders.cpp:
2021         (IPC::ArgumentCoder<ScrollableAreaParameters>::encode):
2022         (IPC::ArgumentCoder<ScrollableAreaParameters>::decode):
2023         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
2024         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):
2025
2026 2019-03-23  Zalan Bujtas  <zalan@apple.com>
2027
2028         [ContentChangeObserver] Taping on a form control should always result in click.
2029         https://bugs.webkit.org/show_bug.cgi?id=196177
2030
2031         Reviewed by Simon Fraser.
2032
2033         This patch enures that we send a synthetic click when the traget node is a form control (button, edit field etc) even if
2034         the mousemove brings up some hover content.
2035
2036         * WebProcess/WebPage/ios/WebPageIOS.mm:
2037         (WebKit::WebPage::handleSyntheticClick):
2038
2039 2019-03-23  Andy Estes  <aestes@apple.com>
2040
2041         [Apple Pay] Stop calling PKPaymentAuthorizationViewController class methods on iOS
2042         https://bugs.webkit.org/show_bug.cgi?id=196163
2043         <rdar://problem/48787564>
2044
2045         Reviewed by Anders Carlsson.
2046
2047         Now that we've transitioned to PKPaymentAuthorizationController on iOS, we should stop
2048         calling PKPaymentAuthorizationViewController class methods on iOS in favor of their
2049         PKPaymentAuthorizationController alternatives.
2050
2051         While we're here, we should also transition to calling
2052         +paymentServicesMerchantURLForAPIType:completion: on both
2053         PKPaymentAuthorizationViewController and PKPaymentAuthorizationController.
2054
2055         * Platform/cocoa/PaymentAuthorizationViewController.mm:
2056         (-[WKPaymentAuthorizationViewControllerDelegate _paymentServicesMerchantURLForAPIType:completion:]):
2057         * Platform/cocoa/WKPaymentAuthorizationDelegate.h:
2058         * Platform/cocoa/WKPaymentAuthorizationDelegate.mm:
2059         (-[WKPaymentAuthorizationDelegate _initWithRequest:presenter:]):
2060         (-[WKPaymentAuthorizationDelegate _paymentServicesMerchantURLForAPIType:completion:]):
2061         * Platform/ios/PaymentAuthorizationController.mm:
2062         (-[WKPaymentAuthorizationControllerDelegate _paymentServicesMerchantURLForAPIType:completion:]):
2063         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2064         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments): Deleted.
2065         * Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
2066         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
2067         * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
2068         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
2069
2070 2019-03-23  Carlos Garcia Campos  <cgarcia@igalia.com>
2071
2072         Unreviewed. Fix GTK build after r243409.
2073
2074         Build failure is actually unrelated to r243409, it's yet another unified build failure that happens when source
2075         file list changes.
2076
2077         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
2078         (WebKit::WebInspectorProxy::platformShowCertificate): Use WebCore namespace for CertificateInfo parameter.
2079
2080 2019-03-23  Carlos Garcia Campos  <cgarcia@igalia.com>
2081
2082         [GTK] Remove build time dependency on Geoclue2
2083         https://bugs.webkit.org/show_bug.cgi?id=195994
2084
2085         Reviewed by Michael Catanzaro.
2086
2087         Add GeoclueGeolocationProvider class to provide geolocation position updates using Geoclue2 DBus service.
2088
2089         * PlatformGTK.cmake:
2090         * PlatformWPE.cmake:
2091         * SourcesGTK.txt:
2092         * SourcesWPE.txt:
2093         * UIProcess/API/glib/WebKitGeolocationManager.cpp:
2094         (_WebKitGeolocationPosition::_WebKitGeolocationPosition):
2095         (webkitGeolocationManagerStop):
2096         (webkitGeolocationManagerSetEnableHighAccuracy):
2097         (webkitGeolocationManagerDispose):
2098         (webkit_geolocation_manager_class_init):
2099         * UIProcess/geoclue/GeoclueGeolocationProvider.cpp: Added.
2100         (WebKit::GeoclueGeolocationProvider::GeoclueGeolocationProvider):
2101         (WebKit::GeoclueGeolocationProvider::~GeoclueGeolocationProvider):
2102         (WebKit::GeoclueGeolocationProvider::start):
2103         (WebKit::GeoclueGeolocationProvider::stop):
2104         (WebKit::GeoclueGeolocationProvider::setEnableHighAccuracy):
2105         (WebKit::GeoclueGeolocationProvider::destroyManagerLater):
2106         (WebKit::GeoclueGeolocationProvider::destroyManager):
2107         (WebKit::GeoclueGeolocationProvider::setupManager):
2108         (WebKit::GeoclueGeolocationProvider::createClient):
2109         (WebKit::GeoclueGeolocationProvider::setupClient):
2110         (WebKit::GeoclueGeolocationProvider::startClient):
2111         (WebKit::GeoclueGeolocationProvider::stopClient):
2112         (WebKit::GeoclueGeolocationProvider::requestAccuracyLevel):
2113         (WebKit::GeoclueGeolocationProvider::clientLocationUpdatedCallback):
2114         (WebKit::GeoclueGeolocationProvider::createLocation):
2115         (WebKit::GeoclueGeolocationProvider::locationUpdated):
2116         (WebKit::GeoclueGeolocationProvider::didFail):
2117         * UIProcess/geoclue/GeoclueGeolocationProvider.h: Added.
2118
2119 2019-03-22  Simon Fraser  <simon.fraser@apple.com>
2120
2121         Undo collision with r243390.
2122
2123         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2124         (stringForSSLProtocol):
2125
2126 2019-03-22  Simon Fraser  <simon.fraser@apple.com>
2127
2128         Fix internal builds.
2129
2130         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2131         (stringForSSLProtocol):
2132
2133 2019-03-22  Keith Rollin  <krollin@apple.com>
2134
2135         Enable ThinLTO support in Production builds
2136         https://bugs.webkit.org/show_bug.cgi?id=190758
2137         <rdar://problem/45413233>
2138
2139         Reviewed by Daniel Bates.
2140
2141         Enable building with Thin LTO in Production when using Xcode 10.2 or
2142         later. This change results in a 1.45% progression in PLT5. Full
2143         Production build times increase about 2-3%. Incremental build times
2144         are more severely affected, and so LTO is not enabled for local
2145         engineering builds.
2146
2147         LTO is enabled only on macOS for now, until rdar://problem/49013399,
2148         which affects ARM builds, is fixed.
2149
2150         To change the LTO setting when building locally:
2151
2152         - If building with `make`, specify WK_LTO_MODE={none,thin,full} on the
2153           command line.
2154         - If building with `build-webkit`, specify --lto-mode={none,thin,full}
2155           on the command line.
2156         - If building with `build-root`, specify --lto={none,thin,full} on the
2157           command line.
2158         - If building with Xcode, create a LocalOverrides.xcconfig file at the
2159           top level of your repository directory (if needed) and define
2160           WK_LTO_MODE to full, thin, or none.
2161
2162         * Configurations/Base.xcconfig:
2163
2164 2019-03-22  Chris Dumez  <cdumez@apple.com>
2165
2166         Unreviewed build fix after r243388.
2167
2168         * WebProcess/WebProcess.h:
2169
2170 2019-03-22  Per Arne Vollan  <pvollan@apple.com>
2171
2172         [macOS] Fix sandbox violation
2173         https://bugs.webkit.org/show_bug.cgi?id=196153
2174         <rdar://problem/49123855>
2175
2176         Reviewed by Brent Fulgham.
2177
2178         The sandbox on macOS is blocking the mach lookup.
2179
2180         * WebProcess/com.apple.WebProcess.sb.in:
2181
2182 2019-03-21  Ryan Haddad  <ryanhaddad@apple.com>
2183
2184         Unreviewed, fix the build with recent SDKs.
2185
2186         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2187         (stringForSSLProtocol):
2188
2189 2019-03-22  Chris Dumez  <cdumez@apple.com>
2190
2191         Implement WebProcess freezer opt-in completely on WebContent process side
2192         https://bugs.webkit.org/show_bug.cgi?id=196149
2193
2194         Reviewed by Brady Eidson.
2195
2196         Implement WebProcess freezer opt-in completely on WebContent process side, we do not need
2197         to involve the UIProcess with this and rely on IPC which may be fragile.
2198
2199         In the future, we may want to set freezable state from the UIProcess when the API supports
2200         it. We can move the logic to be fully on the UIProcess side then. In the mean time, it is
2201         likely best not to rely on IPC and process coordination for this.
2202
2203         * UIProcess/WebProcessProxy.cpp:
2204         (WebKit::globalPageMap):
2205         (WebKit::WebProcessProxy::WebProcessProxy):
2206         (WebKit::WebProcessProxy::setIsInProcessCache):
2207         (WebKit::WebProcessProxy::markIsNoLongerInPrewarmedPool):
2208         (WebKit::WebProcessProxy::didFinishLaunching):
2209         (WebKit::WebProcessProxy::validateFreezerStatus): Deleted.
2210         * UIProcess/WebProcessProxy.h:
2211         (WebKit::WebProcessProxy::removeProvisionalPageProxy):
2212         (WebKit::WebProcessProxy::WebPageProxyMap::WebPageProxyMap): Deleted.
2213         (WebKit::WebProcessProxy::WebPageProxyMap::size const): Deleted.
2214         (WebKit::WebProcessProxy::WebPageProxyMap::values): Deleted.
2215         (WebKit::WebProcessProxy::WebPageProxyMap::values const): Deleted.
2216         (WebKit::WebProcessProxy::WebPageProxyMap::begin): Deleted.
2217         (WebKit::WebProcessProxy::WebPageProxyMap::end): Deleted.
2218         (WebKit::WebProcessProxy::WebPageProxyMap::get): Deleted.
2219         (WebKit::WebProcessProxy::WebPageProxyMap::contains const): Deleted.
2220         (WebKit::WebProcessProxy::WebPageProxyMap::isEmpty const): Deleted.
2221         (WebKit::WebProcessProxy::WebPageProxyMap::set): Deleted.
2222         (WebKit::WebProcessProxy::WebPageProxyMap::take): Deleted.
2223         * WebProcess/WebProcess.cpp:
2224         (WebKit::WebProcess::setIsInProcessCache):
2225         (WebKit::WebProcess::markIsNoLongerPrewarmed):
2226         (WebKit::WebProcess::actualPrepareToSuspend):
2227         (WebKit::WebProcess::setFreezable): Deleted.
2228         * WebProcess/WebProcess.h:
2229         * WebProcess/WebProcess.messages.in:
2230         * WebProcess/cocoa/WebProcessCocoa.mm:
2231         (WebKit::WebProcess::updateProcessName):
2232         (WebKit::WebProcess::shouldFreezeOnSuspension const):
2233         (WebKit::WebProcess::updateFreezerStatus):
2234
2235 2019-03-22  Chris Dumez  <cdumez@apple.com>
2236
2237         Prewarmed processes should be usable with any website data store
2238         https://bugs.webkit.org/show_bug.cgi?id=196104
2239
2240         Reviewed by Alex Christensen.
2241
2242         Split WebsiteDataStore-specific data out of WebProcessCreationParameters and into a new
2243         WebProcessDataStoreParameters struct so that we do not need a WebsiteDataStore in order
2244         to lauch and initialize a WebProcess. When the process finally gets used and we thus
2245         know which WebsiteDataStore they will be used for, we send the WebProcessDataStoreParameters
2246         to the process to that it can do its data store-specific initialization.
2247
2248         This allows prewarmed processes not not have a WebsiteDataStore assocated with them. They
2249         can then be used for any WebsiteDataStore when we need them.
2250
2251         This is also used by our dummy WebProcessProxy since it does not have a backing process and
2252         thus has no associated WebsiteDataStore.
2253
2254         * Shared/WebProcessCreationParameters.cpp:
2255         (WebKit::WebProcessCreationParameters::encode const):
2256         (WebKit::WebProcessCreationParameters::decode):
2257         * Shared/WebProcessCreationParameters.h:
2258         * Shared/WebProcessDataStoreParameters.h: Added.
2259         (WebKit::WebProcessDataStoreParameters::encode const):
2260         (WebKit::WebProcessDataStoreParameters::decode):
2261         * UIProcess/API/C/WKContext.cpp:
2262         (WKContextWarmInitialProcess):
2263         * UIProcess/API/Cocoa/WKProcessPool.mm:
2264         (-[WKProcessPool _warmInitialProcess]):
2265         * UIProcess/ServiceWorkerProcessProxy.cpp:
2266         (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
2267         * UIProcess/WebPageProxy.cpp:
2268         (WebKit::WebPageProxy::notifyProcessPoolToPrewarm):
2269         * UIProcess/WebProcessPool.cpp:
2270         (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
2271         (WebKit::WebProcessPool::createNewWebProcess):
2272         (WebKit::WebProcessPool::tryTakePrewarmedProcess):
2273         (WebKit::WebProcessPool::sendWebProcessDataStoreParameters):
2274         (WebKit::WebProcessPool::initializeNewWebProcess):
2275         (WebKit::WebProcessPool::prewarmProcess):
2276         (WebKit::WebProcessPool::processForRegistrableDomain):
2277         (WebKit::WebProcessPool::createWebPage):
2278         (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
2279         * UIProcess/WebProcessPool.h:
2280         (WebKit::WebProcessPool::sendToOneProcess):
2281         * UIProcess/WebProcessProxy.cpp:
2282         (WebKit::WebProcessProxy::create):
2283         (WebKit::WebProcessProxy::WebProcessProxy):
2284         (WebKit::WebProcessProxy::setWebsiteDataStore):
2285         (WebKit::WebProcessProxy::addExistingWebPage):
2286         * UIProcess/WebProcessProxy.h:
2287         (WebKit::WebProcessProxy::websiteDataStore const):
2288         * WebKit.xcodeproj/project.pbxproj:
2289         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
2290         (WebKit::WebMediaKeyStorageManager::setWebsiteDataStore):
2291         * WebProcess/MediaCache/WebMediaKeyStorageManager.h:
2292         * WebProcess/WebProcess.cpp:
2293         (WebKit::WebProcess::initializeWebProcess):
2294         (WebKit::WebProcess::setWebsiteDataStoreParameters):
2295         * WebProcess/WebProcess.h:
2296         * WebProcess/WebProcess.messages.in:
2297         * WebProcess/WebProcessSupplement.h:
2298         (WebKit::WebProcessSupplement::initialize):
2299         (WebKit::WebProcessSupplement::setWebsiteDataStore):
2300         * WebProcess/cocoa/WebProcessCocoa.mm:
2301         (WebKit::WebProcess::platformInitializeWebProcess):
2302         (WebKit::WebProcess::platformSetWebsiteDataStoreParameters):
2303         * WebProcess/win/WebProcessWin.cpp:
2304         (WebKit::WebProcess::platformInitializeWebProcess):
2305         (WebKit::WebProcess::platformSetWebsiteDataStoreParameters):
2306
2307 2019-03-22  Simon Fraser  <simon.fraser@apple.com>
2308
2309         REGRESSION (r242687): Flicker when pinch-zooming pages in macOS Safari
2310         https://bugs.webkit.org/show_bug.cgi?id=196126
2311         rdar://problem/49095791
2312
2313         Reviewed by Antti Koivisto.
2314
2315         The scrolling tree doesn't have an accurate picture of the main view's scroll position
2316         during pinch-zooming, so don't have it apply layer positions if a transient zoom is
2317         in progress.
2318
2319         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2320         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2321         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
2322         (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage):
2323
2324 2019-03-22  Antti Koivisto  <antti@apple.com>
2325
2326         Handle UI side hit testing for ScrollPositioningBehavior::Stationary positioned nodes
2327         https://bugs.webkit.org/show_bug.cgi?id=196100
2328         <rdar://problem/49117933>
2329
2330         Reviewed by Simon Fraser.
2331
2332         Test: fast/scrolling/ios/overflow-scroll-overlap-6.html
2333
2334         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
2335         (WebKit::RemoteLayerTreeNode::relatedScrollContainerIDs const):
2336         (WebKit::RemoteLayerTreeNode::relatedScrollContainerPositioningBehavior const):
2337
2338         Make more generic and save the associated positioning behavior.
2339
2340         (WebKit::RemoteLayerTreeNode::nonAncestorScrollContainerIDs const): Deleted.
2341         (WebKit::RemoteLayerTreeNode::addNonAncestorScrollContainerID): Deleted.
2342         (WebKit::RemoteLayerTreeNode::clearNonAncestorScrollContainerIDs): Deleted.
2343         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
2344         (WebKit::RemoteLayerTreeNode::setRelatedScrollContainerBehaviorAndIDs):
2345         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
2346         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
2347         (WebKit::isScrolledBy):
2348
2349         Stationary relationship means the layer won't scroll the scroller.
2350
2351         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
2352         (WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations):
2353
2354 2019-03-22  Chris Dumez  <cdumez@apple.com>
2355
2356         REGRESSION (r243094): ePub files do not render or open in Books
2357         https://bugs.webkit.org/show_bug.cgi?id=196119
2358         <rdar://problem/49121686>
2359
2360         Reviewed by Brady Eidson.
2361
2362         Do not delay the WebProcess launch until a load when contructing a web view and the client
2363         may observe when its injected bundle is loaded via WKProcessGroupDelegate's
2364         didCreateConnectionToWebProcessPlugIn.
2365
2366         * UIProcess/API/Cocoa/WKProcessGroup.mm:
2367         (-[WKProcessGroup setDelegate:]):
2368         * UIProcess/WebInspectorUtilities.cpp:
2369         (WebKit::inspectorProcessPool):
2370         * UIProcess/WebProcessPool.cpp:
2371         (WebKit::WebProcessPool::createWebPage):
2372         * UIProcess/WebProcessPool.h:
2373
2374 2019-03-22  Carlos Garcia Campos  <cgarcia@igalia.com>
2375
2376         REGRESSION(r243094): Automation: browser crash in WebAutomationSession::exitFullscreenWindowForPage()
2377         https://bugs.webkit.org/show_bug.cgi?id=196140
2378
2379         Reviewed by Chris Dumez.
2380
2381         Since r243094, the WebPageProxy fullscreen manager is not created in the constructor, but once the page has a
2382         process launched.
2383
2384         * UIProcess/Automation/WebAutomationSession.cpp:
2385         (WebKit::WebAutomationSession::exitFullscreenWindowForPage): Null check WebPageProxy::fullScreenManager() before
2386         using it.
2387
2388 2019-03-22  Timothy Hatcher  <timothy@apple.com>
2389
2390         Change macosx() to macos() in WK_API... and JSC_API... macros.
2391         https://bugs.webkit.org/show_bug.cgi?id=196106
2392
2393         Reviewed by Brian Burg.
2394
2395         * Shared/API/Cocoa/WKBrowsingContextHandle.h:
2396         * Shared/API/Cocoa/WKDragDestinationAction.h:
2397         * Shared/API/Cocoa/WKMain.h:
2398         * Shared/API/Cocoa/_WKFrameHandle.h:
2399         * Shared/API/Cocoa/_WKHitTestResult.h:
2400         * Shared/API/Cocoa/_WKNSWindowExtras.h:
2401         * Shared/API/Cocoa/_WKRemoteObjectInterface.h:
2402         * Shared/API/Cocoa/_WKRemoteObjectRegistry.h:
2403         * Shared/API/Cocoa/_WKRenderingProgressEvents.h:
2404         * Shared/API/Cocoa/_WKSameDocumentNavigationType.h:
2405         * UIProcess/API/C/WKPage.h:
2406         * UIProcess/API/Cocoa/NSAttributedString.h:
2407         * UIProcess/API/Cocoa/WKBackForwardList.h:
2408         * UIProcess/API/Cocoa/WKBackForwardListItem.h:
2409         * UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h:
2410         * UIProcess/API/Cocoa/WKBrowsingContextLoadDelegate.h:
2411         * UIProcess/API/Cocoa/WKContentRuleList.h:
2412         * UIProcess/API/Cocoa/WKContentRuleListStore.h:
2413         * UIProcess/API/Cocoa/WKError.h:
2414         * UIProcess/API/Cocoa/WKErrorPrivate.h:
2415         * UIProcess/API/Cocoa/WKFrameInfo.h:
2416         * UIProcess/API/Cocoa/WKFrameInfoPrivate.h:
2417         * UIProcess/API/Cocoa/WKHTTPCookieStore.h:
2418         * UIProcess/API/Cocoa/WKMenuItemIdentifiersPrivate.h:
2419         * UIProcess/API/Cocoa/WKNavigation.h:
2420         * UIProcess/API/Cocoa/WKNavigationAction.h:
2421         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
2422         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
2423         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2424         * UIProcess/API/Cocoa/WKNavigationResponse.h:
2425         * UIProcess/API/Cocoa/WKOpenPanelParameters.h:
2426         * UIProcess/API/Cocoa/WKOpenPanelParametersPrivate.h:
2427         * UIProcess/API/Cocoa/WKPreferences.h:
2428         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2429         * UIProcess/API/Cocoa/WKProcessPool.h:
2430         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2431         * UIProcess/API/Cocoa/WKScriptMessage.h:
2432         * UIProcess/API/Cocoa/WKSecurityOrigin.h:
2433         * UIProcess/API/Cocoa/WKSnapshotConfiguration.h:
2434         * UIProcess/API/Cocoa/WKUIDelegate.h:
2435         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2436         * UIProcess/API/Cocoa/WKURLSchemeHandler.h:
2437         * UIProcess/API/Cocoa/WKURLSchemeTask.h:
2438         * UIProcess/API/Cocoa/WKURLSchemeTaskPrivate.h:
2439         * UIProcess/API/Cocoa/WKUserContentController.h:
2440         * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
2441         * UIProcess/API/Cocoa/WKUserScript.h:
2442         * UIProcess/API/Cocoa/WKUserScriptPrivate.h:
2443         * UIProcess/API/Cocoa/WKViewPrivate.h:
2444         * UIProcess/API/Cocoa/WKWebView.h:
2445         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
2446         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2447         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2448         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
2449         * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
2450         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
2451         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2452         * UIProcess/API/Cocoa/WKWindowFeatures.h:
2453         * UIProcess/API/Cocoa/WKWindowFeaturesPrivate.h:
2454         * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
2455         * UIProcess/API/Cocoa/_WKApplicationManifest.h:
2456         * UIProcess/API/Cocoa/_WKAttachment.h:
2457         * UIProcess/API/Cocoa/_WKAutomationDelegate.h:
2458         * UIProcess/API/Cocoa/_WKAutomationSession.h:
2459         * UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.h:
2460         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
2461         * UIProcess/API/Cocoa/_WKContextMenuElementInfo.h:
2462         * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
2463         * UIProcess/API/Cocoa/_WKDownload.h:
2464         * UIProcess/API/Cocoa/_WKDownloadDelegate.h:
2465         * UIProcess/API/Cocoa/_WKElementAction.h:
2466         * UIProcess/API/Cocoa/_WKExperimentalFeature.h:
2467         * UIProcess/API/Cocoa/_WKFindOptions.h:
2468         * UIProcess/API/Cocoa/_WKFocusedElementInfo.h:
2469         * UIProcess/API/Cocoa/_WKFormInputSession.h:
2470         * UIProcess/API/Cocoa/_WKFullscreenDelegate.h:
2471         * UIProcess/API/Cocoa/_WKGeolocationCoreLocationProvider.h:
2472         * UIProcess/API/Cocoa/_WKInspector.h:
2473         * UIProcess/API/Cocoa/_WKInspectorWindow.h:
2474         * UIProcess/API/Cocoa/_WKInternalDebugFeature.h:
2475         * UIProcess/API/Cocoa/_WKLayoutMode.h:
2476         * UIProcess/API/Cocoa/_WKLinkIconParameters.h:
2477         * UIProcess/API/Cocoa/_WKOverlayScrollbarStyle.h:
2478         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2479         * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h:
2480         * UIProcess/API/Cocoa/_WKSessionState.h:
2481         * UIProcess/API/Cocoa/_WKTextInputContext.h:
2482         * UIProcess/API/Cocoa/_WKThumbnailView.h:
2483         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.h:
2484         * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h:
2485         * UIProcess/API/Cocoa/_WKUserContentFilter.h:
2486         * UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h:
2487         * UIProcess/API/Cocoa/_WKUserContentWorld.h:
2488         * UIProcess/API/Cocoa/_WKUserInitiatedAction.h:
2489         * UIProcess/API/Cocoa/_WKUserStyleSheet.h:
2490         * UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
2491         * UIProcess/API/Cocoa/_WKWebsiteDataSize.h:
2492         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
2493         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
2494         * UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h:
2495         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
2496         * WebProcess/API/Cocoa/WKWebProcess.h:
2497         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
2498         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:
2499         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResult.h:
2500         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
2501         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h:
2502         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.h:
2503         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.h:
2504         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h:
2505         * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h:
2506         * WebProcess/InjectedBundle/API/mac/WKDOMElement.h:
2507         * WebProcess/InjectedBundle/API/mac/WKDOMNode.h:
2508         * WebProcess/InjectedBundle/API/mac/WKDOMRange.h:
2509         * WebProcess/InjectedBundle/API/mac/WKDOMText.h:
2510         * WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.h:
2511         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
2512         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.h:
2513         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
2514
2515 2019-03-22  Yousuke Kimoto  <Yousuke.Kimoto@sony.com>
2516
2517         Unreviewed build fix.
2518
2519         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2520
2521 2019-03-22  Tim Horton  <timothy_horton@apple.com>
2522
2523         Fix the build after r243354
2524         https://bugs.webkit.org/show_bug.cgi?id=196138
2525         <rdar://problem/49145951>
2526
2527         * Platform/spi/ios/UIKitSPI.h:
2528         * Shared/DocumentEditingContext.mm:
2529         (WebKit::DocumentEditingContext::toPlatformContext):
2530         * UIProcess/ios/WKContentViewInteraction.mm:
2531
2532 2019-03-21  Simon Fraser  <simon.fraser@apple.com>
2533
2534         Clean up some TiledCoreAnimationDrawingArea members
2535         https://bugs.webkit.org/show_bug.cgi?id=196124
2536
2537         Reviewed by Tim Horton.
2538
2539         The giant m_transform was unused.
2540         
2541         Group the bools etc.
2542
2543         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2544         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2545         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
2546         (WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
2547
2548 2019-03-21  Brady Eidson  <beidson@apple.com>
2549
2550         Certain WebProcesses should opt-out of the freezer.
2551         <rdar://problem/42846139> and https://bugs.webkit.org/show_bug.cgi?id=196062
2552
2553         Reviewed by Andy Estes.
2554
2555         WebProcesses should opt-in and opt-out of the freezer as is appropriate.
2556         By default a WebProcess is freezer eligible.
2557         If any of the following become true then it should become ineligible:
2558         - The WebProcess is a pre-warmed process.
2559         - The WebProcess is in the process cache.
2560         - The WebProcess is not actively hosting any web pages (e.g. it only has suspending web pages)
2561
2562         The most complicated part of the above is guaranteeing that any operation that changes
2563         the active pages hosted by the process causes a recalculation of the freezer opt-in state.
2564
2565         To do that this replaces the basic WebPageProxyMap with a custom class.
2566
2567         * UIProcess/WebProcessProxy.cpp:
2568         (WebKit::globalPageMap):
2569         (WebKit::WebProcessProxy::WebProcessProxy):
2570         (WebKit::WebProcessProxy::validateFreezerStatus):
2571         (WebKit::WebProcessProxy::setIsInProcessCache):
2572         (WebKit::WebProcessProxy::markIsNoLongerInPrewarmedPool):
2573         (WebKit::WebProcessProxy::didFinishLaunching):
2574         * UIProcess/WebProcessProxy.h:
2575         (WebKit::WebProcessProxy::WebPageProxyMap::WebPageProxyMap):
2576         (WebKit::WebProcessProxy::WebPageProxyMap::size const):
2577         (WebKit::WebProcessProxy::WebPageProxyMap::values):
2578         (WebKit::WebProcessProxy::WebPageProxyMap::values const):
2579         (WebKit::WebProcessProxy::WebPageProxyMap::begin):
2580         (WebKit::WebProcessProxy::WebPageProxyMap::end):
2581         (WebKit::WebProcessProxy::WebPageProxyMap::get):
2582         (WebKit::WebProcessProxy::WebPageProxyMap::contains const):
2583         (WebKit::WebProcessProxy::WebPageProxyMap::isEmpty const):
2584         (WebKit::WebProcessProxy::WebPageProxyMap::set):
2585         (WebKit::WebProcessProxy::WebPageProxyMap::take):
2586
2587         * WebProcess/WebProcess.cpp:
2588         (WebKit::WebProcess::setFreezable):
2589         * WebProcess/WebProcess.h:
2590         * WebProcess/WebProcess.messages.in:
2591
2592 2019-03-21  Tim Horton  <timothy_horton@apple.com>
2593
2594         Adopt UIWKDocumentContext
2595         https://bugs.webkit.org/show_bug.cgi?id=196040
2596         <rdar://problem/48642440>
2597
2598         Reviewed by Ryosuke Niwa.
2599
2600         * Platform/spi/ios/UIKitSPI.h:
2601         * Scripts/webkit/messages.py:
2602         * Shared/DocumentEditingContext.h: Added.
2603         * Shared/DocumentEditingContext.mm: Added.
2604         (WebKit::toNSRange):
2605         (WebKit::DocumentEditingContext::toPlatformContext):
2606         (IPC::ArgumentCoder<WebKit::DocumentEditingContext::Range>::encode):
2607         (IPC::ArgumentCoder<WebKit::DocumentEditingContext::Range>::decode):
2608         (IPC::ArgumentCoder<WebKit::DocumentEditingContext::TextRect>::encode):
2609         (IPC::ArgumentCoder<WebKit::DocumentEditingContext::TextRect>::decode):
2610         (IPC::ArgumentCoder<WebKit::DocumentEditingContext>::encode):
2611         (IPC::ArgumentCoder<WebKit::DocumentEditingContext>::decode):
2612         (IPC::ArgumentCoder<WebKit::DocumentEditingContextRequest>::encode):
2613         (IPC::ArgumentCoder<WebKit::DocumentEditingContextRequest>::decode):
2614         Add DocumentEditingContext(Request), and coders.
2615         Also expose DocumentEditingContext::toPlatformContext, which populates
2616         a UIWKDocumentContext with the relevant values.
2617
2618         * SourcesCocoa.txt:
2619         * UIProcess/WebPageProxy.h:
2620         * UIProcess/ios/WKContentViewInteraction.mm:
2621         (toWebDocumentRequestOptions):
2622         (toWebRequest):
2623         (-[WKContentView adjustSelectionWithDelta:completionHandler:]):
2624         (-[WKContentView requestDocumentContext:completionHandler:]):
2625         (-[WKContentView selectPositionAtPoint:withContextRequest:completionHandler:]):
2626         * UIProcess/ios/WebPageProxyIOS.mm:
2627         (WebKit::WebPageProxy::adjustSelectionWithDelta):
2628         (WebKit::WebPageProxy::requestDocumentEditingContext):
2629         * WebKit.xcodeproj/project.pbxproj:
2630         * WebProcess/WebPage/WebPage.h:
2631         * WebProcess/WebPage/WebPage.messages.in:
2632         Plumb DocumentEditingContext(Request) around.
2633
2634         * WebProcess/WebPage/ios/WebPageIOS.mm:
2635         (WebKit::WebPage::adjustSelectionWithDelta):
2636         Adjust the current selection given deltas to apply to the location and length.
2637
2638         (WebKit::visiblePositionAdjacentToVisiblePosition):
2639         (WebKit::visiblePositionForPointInRootViewCoordinates):
2640         (WebKit::WebPage::requestDocumentEditingContext):
2641         Retrieve the relevant part of the selection, as well as the context,
2642         given either the selection, or a rect.
2643         If we're collecting context for a rect, we split the context between
2644         before and after (except for the part that intersects the selection).
2645         The three strings will always be directly adjacent, and any of the three
2646         can sometimes be null.
2647
2648 2019-03-21  James Magahern  <jmagahern@apple.com>
2649
2650         Long press gesture recognizers in WKWebView are conflicting with internal scroll view long press gesture recognizers
2651         https://bugs.webkit.org/show_bug.cgi?id=195726
2652         rdar://problem/48582449
2653
2654         Reviewed by Megan Gardner.
2655
2656         We just need to add another clause to WKContentViewInteraction's
2657         canPreventGestureRecognizer whitelist. 
2658
2659         * UIProcess/ios/WKContentViewInteraction.mm:
2660         (-[WKContentView gestureRecognizer:canPreventGestureRecognizer:]):
2661
2662 2019-03-21  Simon Fraser  <simon.fraser@apple.com>
2663
2664         [iOS WK2] Turn on async overflow scrolling by default
2665         https://bugs.webkit.org/show_bug.cgi?id=196011
2666         rdar://problem/48453859
2667
2668         Reviewed by Antti Koivisto.
2669
2670         * Shared/WebPreferences.yaml:
2671         * Shared/WebPreferencesDefaultValues.h:
2672
2673 2019-03-21  Alex Christensen  <achristensen@webkit.org>
2674
2675         Remove last use of LegacySync IPC messages
2676         https://bugs.webkit.org/show_bug.cgi?id=196113
2677
2678         Reviewed by Chris Dumez.
2679
2680         Also rename "Delayed" to "Synchronous" now that there's only one type of synchronous message.
2681
2682         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2683         * NetworkProcess/NetworkProcess.messages.in:
2684         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
2685         (WebKit::WebSWServerConnection::syncTerminateWorkerFromClient):
2686         * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
2687         * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in:
2688         * Platform/IPC/Connection.cpp:
2689         (IPC::Connection::dispatchMessage):
2690         * Platform/IPC/HandleMessage.h:
2691         (IPC::handleMessageSynchronous):
2692         (IPC::handleMessageSynchronousWantsConnection):
2693         (IPC::handleMessageLegacySync): Deleted.
2694         (IPC::handleMessageDelayed): Deleted.
2695         (IPC::handleMessageDelayedWantsConnection): Deleted.
2696         * PluginProcess/PluginControllerProxy.messages.in:
2697         * PluginProcess/WebProcessConnection.messages.in:
2698         * Scripts/webkit/LegacyMessageReceiver-expected.cpp:
2699         (WebKit::WebPage::didReceiveSyncWebPageMessage):
2700         * Scripts/webkit/MessageReceiver-expected.cpp:
2701         (WebKit::WebPage::didReceiveSyncMessage):
2702         * Scripts/webkit/MessageReceiverSuperclass-expected.cpp:
2703         (Messages::WebPage::TestSyncMessage::send):
2704         (Messages::WebPage::TestSynchronousMessage::send):
2705         (WebKit::WebPage::didReceiveSyncMessage):
2706         (Messages::WebPage::TestDelayedMessage::send): Deleted.
2707         * Scripts/webkit/MessagesSuperclass-expected.h:
2708         (Messages::WebPage::TestSynchronousMessage::name):
2709         (Messages::WebPage::TestSynchronousMessage::TestSynchronousMessage):
2710         (Messages::WebPage::TestDelayedMessage::receiverName): Deleted.
2711         (Messages::WebPage::TestDelayedMessage::name): Deleted.
2712         (Messages::WebPage::TestDelayedMessage::TestDelayedMessage): Deleted.
2713         (Messages::WebPage::TestDelayedMessage::arguments const): Deleted.
2714         * Scripts/webkit/messages.py:
2715         * Scripts/webkit/messages_unittest.py:
2716         * Scripts/webkit/test-legacy-messages.in:
2717         * Scripts/webkit/test-messages.in:
2718         * Scripts/webkit/test-superclass-messages.in:
2719         * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in:
2720         * Shared/Plugins/NPObjectMessageReceiver.messages.in:
2721         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
2722         * UIProcess/Plugins/PluginProcessProxy.messages.in:
2723         * UIProcess/WebFullScreenManagerProxy.messages.in:
2724         * UIProcess/WebPageProxy.messages.in:
2725         * UIProcess/WebPasteboardProxy.messages.in:
2726         * UIProcess/WebProcessPool.messages.in:
2727         * UIProcess/WebProcessProxy.messages.in:
2728         * UIProcess/WebStorage/StorageManager.messages.in:
2729         * UIProcess/mac/SecItemShimProxy.messages.in:
2730         * WebProcess/Plugins/PluginProcessConnection.messages.in:
2731         * WebProcess/Plugins/PluginProxy.messages.in:
2732         * WebProcess/Storage/WebSWClientConnection.cpp:
2733         (WebKit::WebSWClientConnection::syncTerminateWorker):
2734         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
2735         * WebProcess/WebPage/WebPage.messages.in:
2736         * WebProcess/WebProcess.messages.in:
2737
2738 2019-03-21  Brian Burg  <bburg@apple.com>
2739
2740         Web Automation: support uploading non-local file paths
2741         https://bugs.webkit.org/show_bug.cgi?id=196081
2742         <rdar://problem/45819897>
2743
2744         Reviewed by Devin Rousso and Joseph Pecoraro.
2745
2746         To support cases where supplied file paths do not exist on the session host, add support for
2747         receiving file contents via Automation.setFilesToSelectForFileUpload.
2748
2749         * UIProcess/Automation/Automation.json: Add new parameter.
2750
2751         * UIProcess/Automation/WebAutomationSession.h:
2752         * UIProcess/Automation/WebAutomationSession.cpp:
2753         (WebKit::WebAutomationSession::setFilesToSelectForFileUpload):
2754         Add support for receiving and saving file contents to a temporary directory. Rewrite the used paths so
2755         that WebCore knows to look at the revised paths where the file contents have been saved.
2756
2757         (WebKit::WebAutomationSession::platformGenerateLocalFilePathForRemoteFile):
2758         Since WebKit does not have usable FileSystem implementations for all ports, shell out the actual
2759         saving of base64-encoded file data. Provide a Cocoa implementation, since that's what I can test.
2760
2761         * UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm:
2762         (WebKit::WebAutomationSession::platformGenerateLocalFilePathForRemoteFile):
2763         Use WTF::FileSystem to create a temporary directory, and use Cocoa methods to actually write the file.
2764
2765 2019-03-21  Youenn Fablet  <youenn@apple.com>
2766
2767         Cache API and IDB space usages should be initialized on first quota check
2768         https://bugs.webkit.org/show_bug.cgi?id=195707
2769
2770         Reviewed by Chris Dumez.
2771
2772         When the quota manager is created, make sure it delays quota check decisions until IDB and Cache API quota users are initialized.
2773         For IDB, the creation is synchronous but it may not be synchronous for Cache API.
2774         For that purpose, add a temporary quota user that will stay uninitialized until these two quota users are added.
2775         Once added, the temporary quota user is removed.
2776         The addition of the real users is made asynchronously as this is triggered by the creation of one of the two quota users.
2777
2778         In the case of a Cache API caches being cleared, make sure to reset the size to zero and to redo the quota user initialization dance.
2779
2780         * NetworkProcess/NetworkProcess.cpp:
2781         (WebKit::QuotaUserInitializer::initialize):
2782         (WebKit::QuotaUserInitializer::~QuotaUserInitializer):
2783         (WebKit::QuotaUserInitializer::QuotaUserInitializer):
2784         (WebKit::NetworkProcess::storageQuotaManager):
2785         * NetworkProcess/cache/CacheStorageEngine.cpp:
2786         (WebKit::CacheStorage::Engine::initializeQuotaUser):
2787         * NetworkProcess/cache/CacheStorageEngine.h:
2788         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2789         (WebKit::CacheStorage::Caches::clear):
2790
2791 2019-03-21  Per Arne Vollan  <pvollan@apple.com>
2792
2793         [iOS][macOS] Fix sandbox call violations
2794         https://bugs.webkit.org/show_bug.cgi?id=195809
2795         <rdar://problem/48829655>
2796
2797         Reviewed by Brent Fulgham.
2798
2799         An additional syscall needs to be added to the sandbox allow list.
2800
2801         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2802         * WebProcess/com.apple.WebProcess.sb.in:
2803
2804 2019-03-21  Eric Carlson  <eric.carlson@apple.com>
2805
2806         Add UI process WebRTC runtime logging.
2807         https://bugs.webkit.org/show_bug.cgi?id=196020
2808         <rdar://problem/49071443>
2809
2810         Reviewed by Youenn Fablet.
2811
2812         * Platform/Logging.cpp:
2813         (WebKit::getLogChannel): New.
2814         * Platform/Logging.h:
2815         * Shared/WebCoreArgumentCoders.h: Add coders for WTFLogChannelState and WTFLogLevel.
2816
2817         Add runtime logging.
2818         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2819         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
2820         (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture):
2821         (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
2822         (WebKit::UserMediaPermissionRequestManagerProxy::clearCachedState):
2823         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
2824         (WebKit::UserMediaPermissionRequestManagerProxy::denyRequest):
2825         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
2826         (WebKit::UserMediaPermissionRequestManagerProxy::resetAccess):
2827         (WebKit::UserMediaPermissionRequestManagerProxy::grantAccess):
2828         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
2829         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionRequest):
2830         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionInvalidRequest):
2831         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionValidRequest):
2832         (WebKit::UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList):
2833         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
2834         (WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged):
2835         (WebKit::UserMediaPermissionRequestManagerProxy::watchdogTimerFired):
2836         (WebKit::UserMediaPermissionRequestManagerProxy::logChannel const):
2837         (WebKit::convertEnumerationToString):
2838
2839         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2840         (WTF::LogArgument<WebKit::UserMediaPermissionRequestManagerProxy::RequestAction>::toString):
2841         * UIProcess/UserMediaPermissionRequestProxy.cpp:
2842         (WebKit::convertEnumerationToString): Add an enum specialization for logging.
2843
2844         * UIProcess/UserMediaPermissionRequestProxy.h:
2845         (WTF::LogArgument<WebKit::UserMediaPermissionRequestProxy::UserMediaAccessDenialReason>::toString): Ditto.
2846
2847         * UIProcess/WebPageProxy.cpp:
2848         (WebKit::WebPageProxy::logger):
2849         (WebKit::WebPageProxy::configureLoggingChannel):
2850         * UIProcess/WebPageProxy.h:
2851         * UIProcess/WebPageProxy.messages.in:
2852
2853         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2854         (WebKit::WebChromeClient::configureLoggingChannel):
2855         * WebProcess/WebCoreSupport/WebChromeClient.h:
2856         * WebProcess/WebPage/WebPage.cpp:
2857         (WebKit::WebPage::configureLoggingChannel):
2858         * WebProcess/WebPage/WebPage.h:
2859
2860 2019-03-21  Alex Christensen  <achristensen@webkit.org>
2861
2862         Stop using LegacySync messages in WebPageProxy
2863         https://bugs.webkit.org/show_bug.cgi?id=196056
2864
2865         Reviewed by Chris Dumez.
2866
2867         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2868         (WebKit::WebPageProxy::loadRecentSearches):
2869         * UIProcess/ProvisionalPageProxy.cpp:
2870         (WebKit::ProvisionalPageProxy::backForwardGoToItem):
2871         (WebKit::ProvisionalPageProxy::didReceiveSyncMessage):
2872         * UIProcess/ProvisionalPageProxy.h:
2873         * UIProcess/WebPageProxy.cpp:
2874         (WebKit::WebPageProxy::handleSynchronousMessage):
2875         (WebKit::WebPageProxy::hasInsecureContent):
2876         (WebKit::WebPageProxy::accessibilityScreenToRootView):
2877         (WebKit::WebPageProxy::rootViewToAccessibilityScreen):
2878         (WebKit::WebPageProxy::printFrame):
2879         (WebKit::WebPageProxy::backForwardGoToItem):
2880         (WebKit::WebPageProxy::backForwardGoToItemShared):
2881         (WebKit::WebPageProxy::backForwardItemAtIndex):
2882         (WebKit::WebPageProxy::backForwardBackListCount):
2883         (WebKit::WebPageProxy::backForwardForwardListCount):
2884         (WebKit::WebPageProxy::canUndoRedo):
2885         (WebKit::WebPageProxy::executeUndoRedo):
2886         (WebKit::WebPageProxy::checkTextOfParagraph):
2887         (WebKit::WebPageProxy::checkSpellingOfString):
2888         (WebKit::WebPageProxy::checkGrammarOfString):
2889         (WebKit::WebPageProxy::spellingUIIsShowing):
2890         (WebKit::WebPageProxy::getGuessesForWord):
2891         (WebKit::WebPageProxy::substitutionsPanelIsShowing):
2892         (WebKit::WebPageProxy::showCorrectionPanel):
2893         (WebKit::WebPageProxy::dismissCorrectionPanel):
2894         (WebKit::WebPageProxy::dismissCorrectionPanelSoon):
2895         (WebKit::WebPageProxy::recordAutocorrectionResponse):
2896         (WebKit::WebPageProxy::dictationAlternatives):
2897         (WebKit::WebPageProxy::wrapCryptoKey):
2898         (WebKit::WebPageProxy::unwrapCryptoKey):
2899         (WebKit::WebPageProxy::signedPublicKeyAndChallengeString):
2900         (WebKit::WebPageProxy::serializedAttachmentDataForIdentifiers):
2901         (WebKit::WebPageProxy::speechSynthesisVoiceList):
2902         (WebKit::WebPageProxy::printMainFrame): Deleted.
2903         * UIProcess/WebPageProxy.h:
2904         * UIProcess/WebPageProxy.messages.in:
2905         * UIProcess/gtk/WebPageProxyGtk.cpp:
2906         (WebKit::WebPageProxy::createPluginContainer):
2907         * UIProcess/ios/WebPageProxyIOS.mm:
2908         (WebKit::WebPageProxy::interpretKeyEvent):
2909         * UIProcess/mac/WebPageProxyMac.mm:
2910         (WebKit::WebPageProxy::getIsSpeaking):
2911         (WebKit::WebPageProxy::executeSavedCommandBySelector):
2912         (WebKit::WebPageProxy::showPDFContextMenu):
2913
2914 2019-03-21  Alex Christensen  <achristensen@webkit.org>
2915
2916         Stop using LegacySync messages in WebPage
2917         https://bugs.webkit.org/show_bug.cgi?id=196057
2918
2919         Reviewed by Chris Dumez.
2920
2921         * WebProcess/WebPage/WebPage.h:
2922         (WebKit::WebPage::markLayersVolatile):
2923         * WebProcess/WebPage/WebPage.messages.in:
2924         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
2925         (WebKit::WebPage::getCenterForZoomGesture):
2926         * WebProcess/WebPage/ios/WebPageIOS.mm:
2927         (WebKit::WebPage::readSelectionFromPasteboard):
2928         (WebKit::WebPage::getStringSelectionForPasteboard):
2929         (WebKit::WebPage::getDataSelectionForPasteboard):
2930         (WebKit::WebPage::shouldDelayWindowOrderingEvent):
2931         (WebKit::WebPage::acceptsFirstMouse):
2932         * WebProcess/WebPage/mac/WebPageMac.mm:
2933         (WebKit::WebPage::replaceSelectionWithPasteboardData):
2934         (WebKit::WebPage::readSelectionFromPasteboard):
2935         (WebKit::WebPage::getStringSelectionForPasteboard):
2936         (WebKit::WebPage::getDataSelectionForPasteboard):
2937         (WebKit::WebPage::shouldDelayWindowOrderingEvent):
2938         (WebKit::WebPage::acceptsFirstMouse):
2939
2940 2019-03-21  Alex Christensen  <achristensen@webkit.org>
2941
2942         Stop using LegacySync messages in WebPasteboardProxy
2943         https://bugs.webkit.org/show_bug.cgi?id=196060
2944
2945         Reviewed by Chris Dumez.
2946
2947         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2948         (WebKit::WebPasteboardProxy::getPasteboardTypes):
2949         (WebKit::WebPasteboardProxy::getPasteboardPathnamesForType):
2950         (WebKit::WebPasteboardProxy::getPasteboardStringForType):
2951         (WebKit::WebPasteboardProxy::getPasteboardStringsForType):
2952         (WebKit::WebPasteboardProxy::getPasteboardBufferForType):
2953         (WebKit::WebPasteboardProxy::pasteboardCopy):
2954         (WebKit::WebPasteboardProxy::getPasteboardChangeCount):
2955         (WebKit::WebPasteboardProxy::getPasteboardUniqueName):
2956         (WebKit::WebPasteboardProxy::getPasteboardColor):
2957         (WebKit::WebPasteboardProxy::getPasteboardURL):
2958         (WebKit::WebPasteboardProxy::addPasteboardTypes):
2959         (WebKit::WebPasteboardProxy::setPasteboardTypes):
2960         (WebKit::WebPasteboardProxy::setPasteboardURL):
2961         (WebKit::WebPasteboardProxy::setPasteboardColor):
2962         (WebKit::WebPasteboardProxy::setPasteboardStringForType):
2963         (WebKit::WebPasteboardProxy::setPasteboardBufferForType):
2964         (WebKit::WebPasteboardProxy::getNumberOfFiles):
2965         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
2966         (WebKit::WebPasteboardProxy::writeCustomData):
2967         (WebKit::WebPasteboardProxy::readStringFromPasteboard):
2968         (WebKit::WebPasteboardProxy::readURLFromPasteboard):
2969         (WebKit::WebPasteboardProxy::readBufferFromPasteboard):
2970         (WebKit::WebPasteboardProxy::getPasteboardItemsCount):
2971         (WebKit::WebPasteboardProxy::allPasteboardItemInfo):
2972         (WebKit::WebPasteboardProxy::informationForItemAtIndex):
2973         * UIProcess/WebPasteboardProxy.cpp:
2974         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
2975         (WebKit::WebPasteboardProxy::writeCustomData):
2976         * UIProcess/WebPasteboardProxy.h:
2977         * UIProcess/WebPasteboardProxy.messages.in:
2978         * UIProcess/gtk/WebPasteboardProxyGtk.cpp:
2979         (WebKit::WebPasteboardProxy::writeToClipboard):
2980         (WebKit::WebPasteboardProxy::readFromClipboard):
2981         * UIProcess/wpe/WebPasteboardProxyWPE.cpp:
2982         (WebKit::WebPasteboardProxy::getPasteboardTypes):
2983         (WebKit::WebPasteboardProxy::readStringFromPasteboard):
2984         (WebKit::WebPasteboardProxy::writeWebContentToPasteboard):
2985         (WebKit::WebPasteboardProxy::writeStringToPasteboard):
2986
2987 2019-03-21  Andy Estes  <aestes@apple.com>
2988
2989         [iOS] Apple Pay should be available in documents with no user agent scripts
2990         https://bugs.webkit.org/show_bug.cgi?id=196061
2991         <rdar://problem/48649391>
2992
2993         Reviewed by Brady Eidson.
2994
2995         * Shared/AuxiliaryProcess.h:
2996         * Shared/Cocoa/AuxiliaryProcessCocoa.mm:
2997         (WebKit::AuxiliaryProcess::parentProcessHasEntitlement):
2998
2999         Added a convenience function for checking parent process entitlements.
3000
3001         * Shared/WebPreferences.yaml:
3002         * Shared/WebPreferencesDefaultValues.h:
3003         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3004         (-[WKWebViewConfiguration init]):
3005
3006         Enabled Apple Pay by default on platforms that enable APPLE_PAY_REMOTE_UI.
3007
3008         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
3009         (WebKit::WebPaymentCoordinator::supportsUnrestrictedApplePay const):
3010         * WebProcess/ApplePay/WebPaymentCoordinator.h:
3011
3012         Implemented supportsUnrestrictedApplePay by checking for the
3013         com.apple.private.WebKit.UnrestrictedApplePay entitlement on platforms that enable
3014         APPLE_PAY_REMOTE_UI.
3015
3016         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
3017         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
3018         (didClearWindowObjectForFrame):
3019         (setUpPageLoaderClient):
3020
3021         Added injected bundle SPI that TestWebKitAPI uses to inject the WebCore Internals interface.
3022
3023         * WebProcess/WebPage/WebPage.cpp:
3024         (WebKit::WebPage::runJavaScript):
3025
3026         Changed to call ScriptController::executeUserAgentScriptInWorld.
3027
3028 2019-03-21  Chris Dumez  <cdumez@apple.com>
3029
3030         WebKit should throw when trying to create a WKWebView with a related view that is using a different data store
3031         https://bugs.webkit.org/show_bug.cgi?id=196041
3032         <rdar://problem/49083230>
3033
3034         Reviewed by Alex Christensen.
3035
3036         WebKit should throw when trying to create a WKWebView with a related view that is using a different data store.
3037         We do not support having several WebsiteDataStores sharing the same WebProcess.
3038
3039         * UIProcess/API/Cocoa/WKWebView.mm:
3040         (-[WKWebView _initializeWithConfiguration:]):
3041         * UIProcess/WebProcessPool.cpp:
3042         (WebKit::WebProcessPool::createWebPage):
3043
3044 2019-03-21  Alex Christensen  <achristensen@webkit.org>
3045
3046         Add SPI to inform applications of WKContentRuleList actions
3047         https://bugs.webkit.org/show_bug.cgi?id=195965
3048         <rdar://problem/42664365>
3049
3050         Reviewed by Geoff Garen.
3051
3052         * NetworkProcess/NetworkLoadChecker.cpp:
3053         (WebKit::NetworkLoadChecker::checkRequest):
3054         (WebKit::NetworkLoadChecker::processContentRuleListsForLoad):
3055         (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad): Deleted.
3056         * NetworkProcess/NetworkLoadChecker.h:
3057         * UIProcess/API/APINavigationClient.h:
3058         (API::NavigationClient::contentRuleListNotification):
3059         * UIProcess/API/C/WKPage.cpp:
3060         (WKPageSetPageNavigationClient):
3061         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
3062         * UIProcess/Cocoa/NavigationState.h:
3063         * UIProcess/Cocoa/NavigationState.mm:
3064         (WebKit::NavigationState::setNavigationDelegate):
3065         (WebKit::NavigationState::NavigationClient::contentRuleListNotification):
3066         * UIProcess/WebPageProxy.cpp:
3067         (WebKit::WebPageProxy::contentRuleListNotification):
3068         * UIProcess/WebPageProxy.h:
3069         * UIProcess/WebPageProxy.messages.in:
3070         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3071         (WebKit::WebChromeClient::contentRuleListNotification):
3072         * WebProcess/WebCoreSupport/WebChromeClient.h:
3073
3074 2019-03-21  Simon Fraser  <simon.fraser@apple.com>
3075
3076         Add an internal feature flag to disable the -webkit-overflow-scrolling CSS property
3077         https://bugs.webkit.org/show_bug.cgi?id=196058
3078         rdar://problem/49078202
3079
3080         Reviewed by Antti Koivisto.
3081
3082         Add an internal feature flag called "LegacyOverflowScrollingTouchEnabled", initially
3083         on by default.
3084
3085         * Shared/WebPreferences.yaml:
3086
3087 2019-03-21  Antti Koivisto  <antti@apple.com>
3088
3089         UI-process hit-testing needs to know about containing block relationships
3090         https://bugs.webkit.org/show_bug.cgi?id=195845
3091         <rdar://problem/48949633>
3092
3093         Reviewed by Simon Fraser.
3094
3095         Test: fast/scrolling/ios/overflow-scroll-overlap-5.html
3096
3097         When an overflow scroller contains a positioned element the element may not be on a descendant layer of the scroller,
3098         yet should move along with it. This needs to be taken into account in UI-side hit testing.
3099
3100         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
3101         (WebKit::RemoteLayerTreeNode::nonAncestorScrollContainerIDs const):
3102         (WebKit::RemoteLayerTreeNode::addNonAncestorScrollContainerID):
3103         (WebKit::RemoteLayerTreeNode::clearNonAncestorScrollContainerIDs):
3104
3105         Maintain non-ancestor scrolling relationships for layers.
3106
3107         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
3108         (WebKit::RemoteScrollingCoordinatorProxy::commitScrollingTreeState):
3109         (WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations):
3110         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
3111         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
3112         (WebKit::isScrolledBy):
3113
3114         Helper to figure out who scrolls who.
3115
3116         (-[UIView _web_findDescendantViewAtPoint:withEvent:]):
3117         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
3118         (WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations):
3119
3120         After commit, pull the non-ancestor scrolling relationships from the scrolling tree and update the layer tree.
3121
3122 2019-03-21  Daniel Bates  <dabates@apple.com>
3123
3124         [iOS] Inline -_ensureFormAccessoryView into -formAccessoryView and have -_updateAccessory ensure we have a form accessory
3125         https://bugs.webkit.org/show_bug.cgi?id=196021
3126
3127         Reviewed by Wenson Hsieh.
3128
3129         Every caller of -_ensureFormAccessoryView, except -formAccessoryView, immediately follows the call
3130         with a call to -_updateAccessory. Let's just have -_updateAccessory ensure we have a form accessory
3131         view and inline the implementation of -_ensureFormAccessoryView into -formAccessoryView so we can
3132         remove one method.
3133
3134         * UIProcess/ios/WKContentViewInteraction.mm:
3135         (-[WKContentView inputView]): Remove call to -_ensureFormAccessoryView, -_updateAccessory will do
3136         the equivalent work for us.
3137         (-[WKContentView formAccessoryView]): Moved implementation of -_ensureFormAccessoryView into here.
3138         (-[WKContentView _updateAccessory]): Call self.formAccessoryView to ensure we have a form accessory view.
3139         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
3140         Remove call to -_ensureFormAccessoryView, -_updateAccessory will do
3141         the equivalent work for us.
3142         (-[WKContentView _ensureFormAccessoryView]): Deleted.
3143
3144 2019-03-21  Shawn Roberts  <sroberts@apple.com>
3145
3146         Unreviewed, rolling out r243250.
3147
3148         Causing 109 Failures and 2 crashes on iOS Sim Debug
3149         OpenSource/Internal queues
3150
3151         Reverted changeset:
3152
3153         "[iOS WK2] Turn on async overflow scrolling by default"
3154         https://bugs.webkit.org/show_bug.cgi?id=196011
3155         https://trac.webkit.org/changeset/243250
3156
3157 2019-03-21  Brent Fulgham  <bfulgham@apple.com>
3158
3159         Fix possible memory leak when dismissing a color picker
3160         https://bugs.webkit.org/show_bug.cgi?id=196026
3161         <rdar://problem/48778568>
3162
3163         Reviewed by Wenson Hsieh.
3164
3165         Fix a problem with WebPageProxy::endColorPicker where an early return could leave a color picker
3166         with a +1 reference count after dismissing it.
3167
3168         * UIProcess/WebColorPicker.cpp:
3169         (WebKit::WebColorPicker::endPicker):
3170         * UIProcess/WebPageProxy.cpp:
3171         (WebKit::WebPageProxy::endColorPicker):
3172         (WebKit::WebPageProxy::didEndColorPicker):
3173
3174 2019-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
3175
3176         [GTK][WPE] Add API to provide geolocation information
3177         https://bugs.webkit.org/show_bug.cgi?id=195940
3178
3179         Reviewed by Michael Catanzaro.
3180
3181         Add WebKitGeolocationManager public class to handle geolocation position updates. WebKitGeolocationProvider has
3182         been removed and the default implementation based on GeoClue is done by WebKitGeolocationManager.
3183
3184         * PlatformGTK.cmake:
3185         * PlatformWPE.cmake:
3186         * SourcesGTK.txt:
3187         * SourcesWPE.txt:
3188         * UIProcess/API/glib/WebKitGeolocationManager.cpp: Added.
3189         (_WebKitGeolocationPosition::_WebKitGeolocationPosition):
3190         (webkit_geolocation_position_new):
3191         (webkit_geolocation_position_copy):
3192         (webkit_geolocation_position_free):
3193         (webkit_geolocation_position_set_timestamp):
3194         (webkit_geolocation_position_set_altitude):
3195         (webkit_geolocation_position_set_altitude_accuracy):
3196         (webkit_geolocation_position_set_heading):
3197         (webkit_geolocation_position_set_speed):
3198         (webkitGeolocationManagerStop):
3199         (webkitGeolocationManagerSetEnableHighAccuracy):
3200         (webkitGeolocationManagerCreate):
3201         (webkitGeolocationManagerGetProperty):
3202         (webkit_geolocation_manager_class_init):
3203         (webkit_gelocation_manager_update_position):
3204         (webkit_gelocation_manager_failed):
3205         (webkit_geolocation_manager_get_enable_high_accuracy):
3206         * UIProcess/API/glib/WebKitGeolocationManagerPrivate.h: Copied from Source/WebCore/platform/geoclue/GeolocationProviderGeoclueClient.h.
3207         * UIProcess/API/glib/WebKitGeolocationProvider.cpp: Removed.
3208         * UIProcess/API/glib/WebKitGeolocationProvider.h: Removed.
3209         * UIProcess/API/glib/WebKitWebContext.cpp:
3210         (webkitWebContextConstructed): Create a WebKitGeolocationManager instead of a WebKitGeolocationProvider.
3211         (webkit_web_context_get_geolocation_manager): Get the WebKitGeolocationManager.
3212         * UIProcess/API/gtk/WebKitGeolocationManager.h: Added.
3213         * UIProcess/API/gtk/WebKitWebContext.h:
3214         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
3215         * UIProcess/API/gtk/docs/webkit2gtk-4.0.types:
3216         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
3217         * UIProcess/API/gtk/webkit2.h:
3218         * UIProcess/API/wpe/WebKitGeolocationManager.h: Added.
3219         * UIProcess/API/wpe/WebKitWebContext.h:
3220         * UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
3221         * UIProcess/API/wpe/docs/wpe-docs.sgml:
3222         * UIProcess/API/wpe/webkit.h:
3223
3224 2019-03-20  Youenn Fablet  <youenn@apple.com>
3225
3226         Compute quota after network process restart based on default quota and space used
3227         https://bugs.webkit.org/show_bug.cgi?id=195804
3228
3229         Reviewed by Chris Dumez.
3230
3231         Make sure that Cache Storage quota user waits to declare as initialized to its manager
3232         until all data is loaded so that it can report a valid space used from the start.
3233
3234         Add test API to reset the quota to its default value and compute it according current space use.
3235
3236         * NetworkProcess/NetworkProcess.cpp:
3237         (WebKit::NetworkProcess::updateQuotaBasedOnSpaceUsageForTesting):
3238         * NetworkProcess/NetworkProcess.h:
3239         * NetworkProcess/NetworkProcess.messages.in:
3240         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3241         (WebKit::CacheStorage::Caches::create):
3242         (WebKit::CacheStorage::Caches::Caches):
3243         (WebKit::CacheStorage::Caches::whenInitialized):
3244         * NetworkProcess/cache/CacheStorageEngineCaches.h:
3245         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
3246         (WebKit::CacheStorageEngineConnection::dereference):
3247         * WebProcess/Cache/WebCacheStorageConnection.cpp:
3248         (WebKit::WebCacheStorageConnection::setQuotaBasedOnSpaceUsage):
3249         * WebProcess/Cache/WebCacheStorageConnection.h:
3250
3251 2019-03-20  Simon Fraser  <simon.fraser@apple.com>
3252
3253         Rename ENABLE_ACCELERATED_OVERFLOW_SCROLLING macro to ENABLE_OVERFLOW_SCROLLING_TOUCH
3254         https://bugs.webkit.org/show_bug.cgi?id=196049
3255
3256         Reviewed by Tim Horton.
3257
3258         This macro is about the -webkit-overflow-scrolling CSS property, not accelerated
3259         overflow scrolling in general, so rename it.
3260
3261         * Configurations/FeatureDefines.xcconfig:
3262
3263 2019-03-20  Jiewen Tan  <jiewen_tan@apple.com>
3264
3265         Extend Networking Process sandbox for some system frameworks
3266         https://bugs.webkit.org/show_bug.cgi?id=196036
3267         <rdar://problem/47594150>
3268
3269         Reviewed by Brent Fulgham.
3270
3271         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
3272         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
3273
3274 2019-03-20  Alex Christensen  <achristensen@webkit.org>
3275
3276         Reduce use of LegacySync IPC message type
3277         https://bugs.webkit.org/show_bug.cgi?id=194835
3278
3279         Reviewed by Darin Adler.
3280
3281         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3282         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
3283         (WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
3284         (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
3285         (WebKit::NetworkConnectionToWebProcess::getRawCookies):
3286         (WebKit::NetworkConnectionToWebProcess::blobSize):
3287         (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
3288         (WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
3289         * NetworkProcess/NetworkConnectionToWebProcess.h:
3290         (WebKit::NetworkConnectionToWebProcess::getNetworkLoadInformationRequest):
3291         (WebKit::NetworkConnectionToWebProcess::getNetworkLoadInformationResponse):
3292         (WebKit::NetworkConnectionToWebProcess::getNetworkLoadIntermediateInformation):
3293         (WebKit::NetworkConnectionToWebProcess::takeNetworkLoadInformationMetrics):
3294         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3295         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
3296         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
3297         (WebKit::UserMediaCaptureManagerProxy::capabilities):
3298         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
3299         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
3300         * UIProcess/Plugins/PluginProcessProxy.h:
3301         * UIProcess/Plugins/PluginProcessProxy.messages.in:
3302         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
3303         (WebKit::PluginProcessProxy::launchProcess):
3304         (WebKit::PluginProcessProxy::launchApplicationAtURL):
3305         (WebKit::PluginProcessProxy::openURL):
3306         (WebKit::PluginProcessProxy::openFile):
3307         * UIProcess/WebFullScreenManagerProxy.cpp:
3308         (WebKit::WebFullScreenManagerProxy::supportsFullScreen):
3309         * UIProcess/WebFullScreenManagerProxy.h:
3310         * UIProcess/WebFullScreenManagerProxy.messages.in:
3311         * WebProcess/WebProcess.cpp:
3312         (WebKit::WebProcess::fetchWebsiteData):
3313         (WebKit::WebProcess::deleteWebsiteData):
3314         (WebKit::WebProcess::deleteWebsiteDataForOrigins):
3315         (WebKit::WebProcess::processWillSuspendImminently):
3316         * WebProcess/WebProcess.h:
3317         * WebProcess/WebProcess.messages.in:
3318
3319 2019-03-20  Keith Rollin  <krollin@apple.com>
3320
3321         Update checks that determine if WebKit is system WebKit
3322         https://bugs.webkit.org/show_bug.cgi?id=195756
3323
3324         Unreviewed tweak of r243251 after unreviewed build fix after r243230.
3325
3326         * Shared/mac/AuxiliaryProcessMac.mm:
3327         (WebKit::AuxiliaryProcess::isSystemWebKit):
3328
3329 2019-03-20  Keith Rollin  <krollin@apple.com>
3330
3331         Update checks that determine if WebKit is system WebKit
3332         https://bugs.webkit.org/show_bug.cgi?id=195756
3333
3334         Unreviewed build fix after r243230.
3335
3336         * Shared/mac/AuxiliaryProcessMac.mm:
3337         (WebKit::AuxiliaryProcess::isSystemWebKit):
3338
3339 2019-03-20  Simon Fraser  <simon.fraser@apple.com>
3340
3341         [iOS WK2] Turn on async overflow scrolling by default
3342         https://bugs.webkit.org/show_bug.cgi?id=196011
3343         rdar://problem/48453859
3344
3345         Reviewed by Antti Koivisto.
3346
3347         Turn async overflow scroll on by default for iOS WK2.
3348
3349         * Shared/WebPreferences.yaml:
3350         * Shared/WebPreferencesDefaultValues.h:
3351
3352 2019-03-20  Youenn Fablet  <youenn@apple.com>
3353
3354         Have smaller default quotas for third party frames
3355         https://bugs.webkit.org/show_bug.cgi?id=195841
3356
3357         Reviewed by Geoffrey Garen.
3358
3359         * NetworkProcess/NetworkProcess.cpp:
3360         (WebKit::NetworkProcess::storageQuotaManager):
3361         For third party iframes, use the default quota divided by 10.
3362
3363 2019-03-20  Dean Jackson  <dino@apple.com>
3364
3365         [iOS] Enable fast clicking everywhere
3366         https://bugs.webkit.org/show_bug.cgi?id=196023
3367         <rdar://problem/49073589>
3368
3369         Reviewed by Wenson Hsieh.
3370
3371         Set FastClicksEverywhere to on by default for iPhone & iPad.
3372
3373         * Shared/WebPreferences.yaml:
3374         * Shared/WebPreferencesDefaultValues.h:
3375
3376 2019-03-20  Chris Dumez  <cdumez@apple.com>
3377
3378         Regression(PSON): ViewGestureController is not properly notified of process swaps on iOS
3379         https://bugs.webkit.org/show_bug.cgi?id=196029
3380         <rdar://problem/48954651>
3381
3382         Reviewed by Tim Horton.
3383
3384         If there is a ViewGestureController when process swapping, make sure we disconnect it
3385         from the old process and reconnect it to the new one. This matches what is done in
3386         WebViewImpl for macOS (see r238356).
3387
3388         * UIProcess/API/Cocoa/WKWebView.mm:
3389         (-[WKWebView _processWillSwap]):
3390         (-[WKWebView _processDidExit]):
3391         (-[WKWebView _didRelaunchProcess]):
3392
3393 2019-03-20  Carlos Garcia Campos  <cgarcia@igalia.com>
3394
3395         [GTK] REGRESSION(r243094): crash when launching minibrowser
3396         https://bugs.webkit.org/show_bug.cgi?id=195951
3397
3398         Reviewed by Joseph Pecoraro.
3399
3400         Always return the inspector from WebPageProxy::inspector() when the page hasn't been closed. The inspector is
3401         created in WebPageProxy constructor and it's safe to use even before a process has been launched, because
3402         m_inspectedPage is null-checked everywhere.
3403
3404         * UIProcess/WebPageProxy.cpp:
3405         (WebKit::WebPageProxy::inspector const):
3406
3407 2019-03-20  Keith Rollin  <krollin@apple.com>
3408
3409         Update checks that determine if WebKit is system WebKit
3410         https://bugs.webkit.org/show_bug.cgi?id=195756
3411
3412         Reviewed by Alexey Proskuryakov.
3413
3414         The system WebKit can be installed in additional locations, so check
3415         for and allow those, too.
3416
3417         * Shared/mac/AuxiliaryProcessMac.mm:
3418         (WebKit::AuxiliaryProcess::isSystemWebKit):
3419
3420 2019-03-20  Per Arne Vollan  <pvollan@apple.com>
3421
3422         [iOS] Unable to PiP web videos in Safari due to sandbox violation
3423         https://bugs.webkit.org/show_bug.cgi?id=196015
3424         <rdar://problem/48867037>
3425
3426         Reviewed by Brent Fulgham.
3427
3428         The sandbox should allow getting the iokit property 'ui-pip'.
3429
3430         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3431
3432 2019-03-20  John Wilander  <wilander@apple.com>
3433
3434         (Test fix) Override minimumTimeBetweenDataRecordsRemoval in ResourceLoadStatisticsStore::shouldRemoveDataRecord() during layout tests
3435         https://bugs.webkit.org/show_bug.cgi?id=196017
3436
3437         Unreviewed test fix.
3438
3439         This patch adds a check of parameters().isRunningTest to the return of
3440         ResourceLoadStatisticsStore::shouldRemoveDataRecord() to allow successive
3441         layout tests to remove website data, effectively overriding the
3442         minimumTimeBetweenDataRecordsRemoval setting.
3443
3444         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
3445         (WebKit::ResourceLoadStatisticsStore::shouldRemoveDataRecords const):
3446
3447 2019-03-20  Daniel Bates  <dabates@apple.com>
3448
3449         [iOS] Group UIWebFormAccessoryDelegate-related code and tighten it up a bit
3450         https://bugs.webkit.org/show_bug.cgi?id=196018
3451
3452         Reviewed by Wenson Hsieh.
3453
3454         * UIProcess/ios/WKContentViewInteraction.mm:
3455         (-[WKContentView accessoryClear]): Use uniform initializer syntax. Code could send the empty
3456         string, but I resisted since null string, as we do now, likely encodes more compactly and we
3457         avoid a per-process alloc.
3458         (-[WKContentView accessoryTab:]): Fix style nit; missing space between capture list and arguments
3459         in lambda. Also use lamdba capture initializer syntax and remove a local.
3460         (-[WKContentView _updateAccessory]): Remove a FIXME as it can't be satified with the current
3461         design without more bookkeeping. The design for showing and hiding an AutoFill button added in
3462         r166933 requires knowing the title for the button when showing it via -setAccessoryViewCustomButtonTitle.
3463         We could re-implement such that -setAccessoryViewCustomButtonTitle: stores the title and calls
3464         -_updateAccessory, but that has the disadvantage of increasing the memory footprint of WKContentView
3465         for the stored title and that seems worse than centralizing the logic in _updateAccessory. So,
3466         let's not fix this FIXME. Now that we are removing the FIXME, change to use an early return style.
3467         (-[WKContentView _hideKeyboard]): Micro optimization; only call _updateAccessory if we have
3468         a form accessory view. This method is called everytime we load a page (more precisely when we
3469         commit the load for a page) in addition to everytime we blur (defocus) an element. No need to
3470         update an accessory if we don't have one.
3471  
3472 2019-03-20  Olivier Robin  <olivierrobin@chromium.org>
3473
3474         Fix _getContentsAsAttributedStringWithCompletionHandler availability for iOS.
3475         https://bugs.webkit.org/show_bug.cgi?id=195999
3476
3477         Reviewed by Tim Horton.
3478
3479         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3480
3481 2019-03-20  Brent Fulgham  <bfulgham@apple.com>
3482
3483         Adopt RegistrableDomain in the Storage Access API prompt code paths
3484         https://bugs.webkit.org/show_bug.cgi?id=195957
3485         <rdar://problem/49048028>
3486
3487         Reviewed by Chris Dumez.
3488
3489         While making the code changes in Bug 195866 we noticed that strings were being
3490         used to pass the origins for the API calls. We should adopt the RegistrableDomain
3491         class to improve type safety and avoid introducing bugs in the future.
3492
3493         * UIProcess/API/APIUIClient.h:
3494         (API::UIClient::requestStorageAccessConfirm):
3495         * UIProcess/API/C/WKPage.cpp:
3496         (WKPageSetPageUIClient):
3497         * UIProcess/Cocoa/UIDelegate.h:
3498         * UIProcess/Cocoa/UIDelegate.mm:
3499         (WebKit::UIDelegate::UIClient::requestStorageAccessConfirm):
3500         * UIProcess/Cocoa/WKStorageAccessAlert.h:
3501         * UIProcess/Cocoa/WKStorageAccessAlert.mm:
3502         (WebKit::presentStorageAccessAlert):
3503         * UIProcess/WebPageProxy.cpp:
3504         (WebKit::WebPageProxy::requestStorageAccessConfirm):
3505
3506 2019-03-20  Chris Dumez  <cdumez@apple.com>
3507
3508         Unreviewed, fix typo in comment added in r243156.
3509
3510         * UIProcess/WebPageProxy.cpp:
3511         (WebKit::WebPageProxy::postMessageToInjectedBundle):
3512
3513 2019-03-20  Chris Dumez  <cdumez@apple.com>
3514
3515         Unreviewed, drop invalid assertions landed in r243163.
3516
3517         Those assertions were causing some API tests to crash.
3518         Also include some post-review suggestions from Darin.
3519
3520         * Shared/CallbackID.h:
3521         (WebKit::CallbackID::operator=):
3522         * Shared/OptionalCallbackID.h:
3523         (WebKit::OptionalCallbackID::operator=):
3524
3525 2019-03-20  Chris Dumez  <cdumez@apple.com>
3526
3527         Unreviewed, fix assertion failures in API tests after r243159.
3528
3529         * UIProcess/VisitedLinkStore.cpp:
3530         (WebKit::VisitedLinkStore::removeProcess):
3531
3532 2019-03-20  Tim Horton  <timothy_horton@apple.com>
3533
3534         Add an platform-driven spell-checking mechanism
3535         https://bugs.webkit.org/show_bug.cgi?id=195795
3536
3537         Reviewed by Ryosuke Niwa.
3538
3539         * DerivedSources-input.xcfilelist:
3540         * DerivedSources-output.xcfilelist:
3541         * DerivedSources.make:
3542         * SourcesCocoa.txt:
3543         * UIProcess/Cocoa/TextCheckingController.h: Added.
3544         * UIProcess/Cocoa/TextCheckingController.mm: Added.
3545         (WebKit::TextCheckingController::TextCheckingController):
3546         (WebKit::TextCheckingController::replaceRelativeToSelection):
3547         (WebKit::TextCheckingController::removeAnnotationRelativeToSelection):
3548         * UIProcess/ios/WKContentViewInteraction.h:
3549         * UIProcess/ios/WKContentViewInteraction.mm:
3550         (-[WKContentView setupInteraction]):
3551         (-[WKContentView replaceSelectionOffset:length:withAnnotatedString:relativeReplacementRange:]):
3552         (-[WKContentView removeAnnotation:forSelectionOffset:length:]):
3553         * WebKit.xcodeproj/project.pbxproj:
3554         * WebProcess/WebPage/WebPage.cpp:
3555         * WebProcess/WebPage/WebPage.h:
3556         (WebKit::WebPage::textCheckingController):
3557         Plumb two UITextInput methods through to the Web Content process.
3558         I added a new object instead of just sticking things on WebPage
3559         because there are quite a few more related ones coming down the pipeline,
3560         and will also end up being messages going in the opposite direction.
3561
3562         * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.h: Added.
3563         * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.messages.in: Added.
3564         * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm: Added.
3565         (WebKit::TextCheckingControllerProxy::TextCheckingControllerProxy):
3566         (WebKit::TextCheckingControllerProxy::~TextCheckingControllerProxy):
3567         (WebKit::relevantMarkerTypes):
3568         (WebKit::TextCheckingControllerProxy::rangeAndOffsetRelativeToSelection):
3569         (WebKit::TextCheckingControllerProxy::replaceRelativeToSelection):
3570         (WebKit::TextCheckingControllerProxy::removeAnnotationRelativeToSelection):
3571         Make it possible for the platform to maintain arbitrary key-value pairs
3572         attached to document ranges, as a way for it to keep track of various
3573         text checking context (e.g. if something has been checked, replaced,
3574         what language it might be, ...).
3575
3576         Allow it to replace the text of a range and the annotations in that range,
3577         or remove annotations in a range. Ranges are specified relative to
3578         the selection.
3579
3580         One large missing piece is giving the platform the ability to retrieve
3581         annotations in a range; that is coming in a future patch.
3582
3583         We translate certain annotations into traditional WebCore spelling
3584         and grammar document markers, for normal display-time treatment.
3585
3586         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
3587         (-[WKAccessibilityWebPageObject convertScreenPointToRootView:]):
3588         (-[WKAccessibilityWebPageObject accessibilityHitTest:]):
3589         Unified sources fixes.
3590
3591 2019-03-19  Jiewen Tan  <jiewen_tan@apple.com>
3592
3593         [WebAuthN] Implement FIDO AppID extension
3594         https://bugs.webkit.org/show_bug.cgi?id=143491
3595         <rdar://problem/48298273>
3596
3597         Reviewed by Brent Fulgham.
3598
3599         In U2fHidAuthenticator::continueSignCommandAfterResponseReceived, it will retry the current command
3600         with the AppID if it exists when SW_WRONG_DATA is received from devices. Noted, it will not set
3601         the AuthenticationExtensionsClientOutputs::appid to false in any circumstances. In other words, the
3602         field will be empty if AppID is supplied in AuthenticationExtensionsClientInputs and not used.
3603
3604         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
3605         (WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
3606         (WebKit::LocalAuthenticator::continueGetAssertionAfterUserConsented):
3607         * UIProcess/WebAuthentication/fido/U2fHidAuthenticator.cpp:
3608         (WebKit::U2fHidAuthenticator::issueSignCommand):
3609         (WebKit::U2fHidAuthenticator::continueSignCommandAfterResponseReceived):
3610         * UIProcess/WebAuthentication/fido/U2fHidAuthenticator.h:
3611
3612 2019-03-19  Ross Kirsling  <ross.kirsling@sony.com>
3613
3614         Unreviewed adjustment to r242842 per Darin's request.
3615
3616         * Platform/win/LoggingWin.cpp:
3617         (WebKit::logLevelString):
3618
3619 2019-03-19  Gyuyoung Kim  <gyuyoung.kim@lge.com>
3620
3621         [WPE] Fix build warnings because of missing an argument when initializing wpe_input_axis_event
3622         https://bugs.webkit.org/show_bug.cgi?id=195931
3623
3624         Reviewed by Michael Catanzaro.
3625
3626         There are still build warnings when building wpe port. It looks like
3627         these build warnings have been caused by missing to set an argument
3628         for the modifier parameter of wpe_input_axis_event. This patch sets 0
3629         for the modifier argument to avoid the build warnings.
3630
3631         * UIProcess/API/wpe/ScrollGestureController.cpp:
3632         (WebKit::ScrollGestureController::handleEvent):
3633
3634 2019-03-19  John Wilander  <wilander@apple.com>
3635
3636         Resource Load Statistics (experimental): Clear non-cookie website data for sites that have been navigated to, with link decoration, by a prevalent resource
3637         https://bugs.webkit.org/show_bug.cgi?id=195923
3638         <rdar://problem/49001272>
3639
3640         Reviewed by Alex Christensen.
3641
3642         Cross-site trackers abuse link query parameters to transport user identifiers and then store
3643         them in first-party storage space. To address this, we've done three things:
3644         - r236448 capped all persistent client-side cookies to seven days of storage.
3645         - r242288 further capped persistent client-side cookies for navigations with link decoration from prevalent resources.
3646         - r242603 added logging of navigations with link decoration from prevalent resources.
3647
3648         This patch introduces an experimental feature that removes non-cookie website data for sites
3649         that have been navigated to, with link decoration, by a prevalent resource.
3650
3651         To achieve this, resource domains to remove website data for are now marked with an enum called
3652         WebsiteDataToRemove with values All, AllButHttpOnlyCookies, AllButCookies. As resources are
3653         iterated, they are marked for either of these values and the new function
3654         ResourceLoadStatisticsMemoryStore::shouldRemoveAllButCookiesFor() leads to the marking with
3655         WebsiteDataToRemove::AllButCookies.
3656
3657         Then NetworkProcess::deleteWebsiteDataForRegistrableDomains() looks at this setting and removes
3658         website data accordingly.
3659
3660         The thinking behind this is that the lifetime cap applied in r236448 and r242288 take care of
3661         script writable cookies, and this patch takes care of all other script writable storage.
3662
3663         The infrastructure to handle user interaction expiration is now parameterized so that multiple
3664         expiries can be applied. In this particular case, seven days of browser use.
3665
3666         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
3667         (WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccess):
3668         (WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccessInternal):
3669         (WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUserInteraction):
3670         (WebKit::ResourceLoadStatisticsDatabaseStore::shouldRemoveAllWebsiteDataFor const):
3671         (WebKit::ResourceLoadStatisticsDatabaseStore::shouldRemoveAllButCookiesFor const):
3672         (WebKit::ResourceLoadStatisticsDatabaseStore::registrableDomainsToRemoveWebsiteDataFor):
3673         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
3674         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
3675         (WebKit::ResourceLoadStatisticsMemoryStore::hasHadUserInteraction):
3676         (WebKit::ResourceLoadStatisticsMemoryStore::hasHadUnexpiredRecentUserInteraction const):
3677         (WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveAllWebsiteDataFor const):
3678         (WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveAllButCookiesFor const):
3679         (WebKit::ResourceLoadStatisticsMemoryStore::registrableDomainsToRemoveWebsiteDataFor):
3680         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
3681         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
3682         (WebKit::domainsToString):
3683         (WebKit::ResourceLoadStatisticsStore::removeDataRecords):
3684         (WebKit::ResourceLoadStatisticsStore::statisticsEpirationTime const):
3685         (WebKit::ResourceLoadStatisticsStore::mergeOperatingDates):
3686         (WebKit::ResourceLoadStatisticsStore::includeTodayAsOperatingDateIfNecessary):
3687         (WebKit::ResourceLoadStatisticsStore::hasStatisticsExpired const):
3688         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
3689         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
3690         (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
3691         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomains):
3692         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores): Deleted.
3693            Renamed to reflect that it actually takes a parameter for which types of data to remove.
3694         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
3695         * NetworkProcess/NetworkProcess.cpp:
3696         (WebKit::NetworkProcess::initializeNetworkProcess):
3697         (WebKit::NetworkProcess::setCrossSiteLoadWithLinkDecorationForTesting):
3698         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
3699         (WebKit::NetworkProcess::deleteCookiesForTesting):
3700         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores): Deleted.
3701            Renamed to reflect that it actually takes a parameter for which types of data to remove.
3702         * NetworkProcess/NetworkProcess.h:
3703         * NetworkProcess/NetworkProcess.messages.in:
3704         * NetworkProcess/NetworkProcessCreationParameters.cpp:
3705         (WebKit::NetworkProcessCreationParameters::encode const):
3706         (WebKit::NetworkProcessCreationParameters::decode):
3707         * NetworkProcess/NetworkProcessCreationParameters.h:
3708         * NetworkProcess/NetworkSession.cpp:
3709         (WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomains):
3710         (WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores): Deleted.
3711            Renamed to reflect that it actually takes a parameter for which types of data to remove.
3712         * NetworkProcess/NetworkSession.h:
3713         * Shared/WebPreferences.yaml:
3714         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
3715         (WKWebsiteDataStoreSetStatisticsCrossSiteLoadWithLinkDecoration):
3716         (WKWebsiteDataStoreSetStatisticsTimeToLiveUserInteraction):
3717         (WKWebsiteDataStoreStatisticsProcessStatisticsAndDataRecords):
3718         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
3719         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3720         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
3721         * UIProcess/Network/NetworkProcessProxy.cpp:
3722         (WebKit::NetworkProcessProxy::setCrossSiteLoadWithLinkDecorationForTesting):
3723         * UIProcess/Network/NetworkProcessProxy.h:
3724         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3725         (WebKit::WebsiteDataStore::setCrossSiteLoadWithLinkDecorationForTesting):
3726         * UIProcess/WebsiteData/WebsiteDataStore.h:
3727
3728 2019-03-19  Chris Dumez  <cdumez@apple.com>
3729
3730         Unreviewed build fix after r243173.
3731
3732         * UIProcess/Cocoa/UIDelegate.mm:
3733         (WebKit::UIDelegate::UIClient::requestStorageAccessConfirm):
3734
3735 2019-03-19  Brent Fulgham  <bfulgham@apple.com>
3736
3737         Add default prompt implementation for the Storage Access API
3738         https://bugs.webkit.org/show_bug.cgi?id=195866
3739         <rdar://problem/45150009>
3740
3741         Reviewed by Chris Dumez.
3742
3743         This patch revises the UIDelegate implementation with a default permission dialog
3744         for the Storage Access API. This allows us to use and test the API in MiniBrowser,
3745         rather than requiring a full-fledged web browser to drive testing.
3746  
3747         * UIProcess/Cocoa/UIDelegate.h:
3748         * UIProcess/Cocoa/UIDelegate.mm:
3749         (WebKit::UIDelegate::UIClient::presentStorageAccessConfirmDialog): Added.
3750         (WebKit::UIDelegate::UIClient::requestStorageAccessConfirm): Modify to call new default
3751         implementation if the WKWebVIew client doesn't implement the necessary SPI.
3752         * UIProcess/Cocoa/WKStorageAccessAlert.h: Added.
3753         * UIProcess/Cocoa/WKStorageAccessAlert.mm: Added.
3754         (WebKit::presentStorageAccessAlert):
3755         * WebKit.xcodeproj/project.pbxproj:
3756
3757 2019-03-19  Conrad Shultz  <conrad_shultz@apple.com>
3758
3759         REGRESSION (r242369): Only use picker-supported UTIs when creating image picker
3760         https://bugs.webkit.org/show_bug.cgi?id=195955
3761
3762         Reviewed by Chris Dumez and Wenson Hsieh.
3763
3764         r242369 started passing UTIs to -[UIImagePickerController setMediaTypes:] that correspond to types accepted by the
3765         file input element. However, UIImagePickerController expects a specific subset of UTIs. In the worst case, if no
3766         expected types are passed, this can cause a crash.
3767
3768         * UIProcess/ios/forms/WKFileUploadPanel.mm:
3769         (UTIsForMIMETypes):
3770         Return a set rather than an array.
3771         (-[WKFileUploadPanel _mediaTypesForPickerSourceType:]):
3772         Rather than hardcode specific UTIs, ask UIImagePickerController for its available types. If an accepted type
3773         is in the list of available types, use it. Otherwise, if an accepted type conforms to an available type,
3774         use the available type. This is an O(n^2) process, but there typically are only a handful of types, so
3775         this seems acceptable.
3776         (-[WKFileUploadPanel _showDocumentPickerMenu]):
3777         Convert the set from UTIsForMIMETypes() to an array.
3778
3779 2019-03-19  Michael Catanzaro  <mcatanzaro@igalia.com>
3780
3781         Build cleanly with GCC 9
3782         https://bugs.webkit.org/show_bug.cgi?id=195920
3783
3784         Reviewed by Chris Dumez.
3785
3786         WebKit triggers three new GCC 9 warnings:
3787
3788         """
3789         -Wdeprecated-copy, implied by -Wextra, warns about the C++11 deprecation of implicitly
3790         declared copy constructor and assignment operator if one of them is user-provided.
3791         """
3792
3793         Solution is to either add a copy constructor or copy assignment operator, if required, or
3794         else remove one if it is redundant.
3795
3796         """
3797         -Wredundant-move, implied by -Wextra, warns about redundant calls to std::move.
3798         -Wpessimizing-move, implied by -Wall, warns when a call to std::move prevents copy elision.
3799         """
3800
3801         These account for most of this patch. Solution is to just remove the bad WTFMove().
3802
3803         Additionally, -Wclass-memaccess has been enhanced to catch a few cases that GCC 8 didn't.
3804         These are solved by casting nontrivial types to void* before using memcpy. (Of course, it
3805         would be safer to not use memcpy on nontrivial types, but that's too complex for this
3806         patch. Searching for memcpy used with static_cast<void*> will reveal other cases to fix.)
3807
3808         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
3809         (WebKit::CacheStorage::Cache::decode):
3810         * Platform/IPC/ArgumentCoders.h:
3811         * Shared/CallbackID.h:
3812         (WebKit::CallbackID::operator=):
3813         * Shared/OptionalCallbackID.h:
3814         (WebKit::OptionalCallbackID::operator=):
3815         * Shared/Plugins/NPIdentifierData.cpp:
3816         (WebKit::NPIdentifierData::decode):
3817         * Shared/Plugins/NPVariantData.cpp:
3818         (WebKit::NPVariantData::decode):
3819         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
3820         (WebKit::NetscapePluginModule::getOrCreate):
3821         * Shared/RTCNetwork.cpp:
3822         (WebKit::RTCNetwork::IPAddress::decode):
3823         * Shared/SessionState.cpp:
3824         (WebKit::HTTPBody::Element::decode):
3825         (WebKit::FrameState::decode):
3826         (WebKit::BackForwardListItemState::decode):
3827         * Shared/WebCompiledContentRuleListData.cpp:
3828         (WebKit::WebCompiledContentRuleListData::decode):
3829         * Shared/WebCoreArgumentCoders.cpp:
3830         (IPC::ArgumentCoder<FloatPoint>::decode):
3831         (IPC::ArgumentCoder<FloatRect>::decode):
3832         (IPC::ArgumentCoder<FloatQuad>::decode):
3833         (IPC::ArgumentCoder<ViewportArguments>::decode):
3834         (IPC::ArgumentCoder<IntPoint>::decode):
3835         (IPC::ArgumentCoder<IntRect>::decode):
3836         (IPC::ArgumentCoder<IntSize>::decode):
3837         (IPC::ArgumentCoder<MimeClassInfo>::decode):
3838         (IPC::ArgumentCoder<PluginInfo>::decode):
3839         (IPC::ArgumentCoder<SelectionRect>::decode):
3840         (IPC::ArgumentCoder<CompositionUnderline>::decode):
3841         (IPC::ArgumentCoder<BlobPart>::decode):
3842         (IPC::ArgumentCoder<TextIndicatorData>::decode):
3843         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
3844         (IPC::ArgumentCoder<ScrollOffsetRange<float>>::decode):
3845         * Shared/WebPageCreationParameters.cpp:
3846         (WebKit::WebPageCreationParameters::decode):
3847         * Shared/WebPlatformTouchPoint.cpp:
3848         (WebKit::WebPlatformTouchPoint::decode):
3849         * Shared/WebsiteData/WebsiteData.cpp:
3850         (WebKit::WebsiteData::Entry::decode):
3851         * Shared/WebsiteDataStoreParameters.cpp:
3852         (WebKit::WebsiteDataStoreParameters::decode):
3853         * UIProcess/API/APIContentRuleListStore.cpp:
3854         (API::decodeContentRuleListMetaData):
3855         * UIProcess/WebPageProxy.cpp:
3856         (WebKit::WebPageProxy::launchProcessForReload):
3857         (WebKit::WebPageProxy::launchProcessWithItem):
3858         (WebKit::WebPageProxy::loadRequest):
3859         (WebKit::WebPageProxy::loadFile):
3860         (WebKit::WebPageProxy::loadData):
3861         (WebKit::WebPageProxy::reload):
3862         * UIProcess/WebProcessCache.cpp:
3863         (WebKit::WebProcessCache::takeProcess):
3864         * UIProcess/WebProcessPool.cpp:
3865         (WebKit::WebProcessPool::findReusableSuspendedPageProcess):
3866         * WebProcess/InjectedBundle/DOM/InjectedBundleCSSStyleDeclarationHandle.cpp:
3867         (WebKit::InjectedBundleCSSStyleDeclarationHandle::getOrCreate):
3868         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
3869         (WebKit::InjectedBundleRangeHandle::getOrCreate):
3870         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3871         (WebKit::InjectedBundle::create):
3872         * WebProcess/Network/WebLoaderStrategy.cpp:
3873         (WebKit::WebLoaderStrategy::tryLoadingSynchronouslyUsingURLSchemeHandler):
3874         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
3875         (WebKit::CompositingCoordinator::createGraphicsLayer):
3876         * WebProcess/WebPage/WebPage.cpp:
3877         (WebKit::WebPage::pdfSnapshotAtSize):
3878         (WebKit::WebPage::createDocumentLoader):
3879         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
3880         (WebKit::StorageNamespaceImpl::copy):
3881
3882 2019-03-19  Chris Dumez  <cdumez@apple.com>
3883
3884         Spew: Unhandled web process message 'VisitedLinkTableController:VisitedLinkStateChanged'
3885         https://bugs.webkit.org/show_bug.cgi?id=194787
3886         <rdar://problem/48175520>
3887
3888         Reviewed by Geoff Garen.
3889
3890         The unhandled 'VisitedLinkTableController:VisitedLinkStateChanged' message logging happens
3891         when IPC is sent to a WebProcess which does not have a VisitedLinkTableController with the
3892         given identifier. VisitedLinkTableController are kept alive by the WebPage in the WebProcess
3893         side so this indicates that there is no WebPage using this VisitedLinkTableController anymore.
3894
3895         In the UIProcess side, our tracking of who is using which VisitedLinkStore was very poor.
3896         WebPageProxy objects would ask their process to register itself with the page's visitedLinkStore
3897         as soon as the WebPage object has been created on the WebProcess side. This part was fine.
3898         However, unregistration from the visitedLinkStores would only happen when either the
3899         visitedLinkStore would get destroyed or when the WebProcess would shutdown. This means that
3900         WebProcess could stay registered with a visitedLinkStore even after the page that was using it
3901         has been closed, which would lead to such logging.
3902
3903         To address the issue, the WebProcessProxy now keeps track for which pages are using which
3904         visitedLinkStore. When a visitedLinkStore is used by a page for the first time, the
3905         WebProcessProxy will register itself with the visitedLinkStore. Similarly, when the last page
3906         using a given visitedLinkStore is closed, the process unregisters itself from the
3907         visitedLinkStore, thus avoiding the bug.
3908
3909         I also simplified a lot the logic for having a page telling the WebProcessProxy it started
3910         using a visitedLinkStore. Previously, it would have to wait until the process is done launching
3911         before notifying the WebProcessProxy. Now, the WebPageProxy merely tells the WebProcessProxy
3912         that it is starting to use a visitedLinkStore as soon as it sent the CreateWebPage IPC to the
3913         WebProcess (no matter if the process is still launching or not). At this point, the
3914         WebProcessProxy registers the page as a user of the visitedLinkStore and takes care of waiting
3915         until it is done launching before registering itself with the visitedLinkStore.
3916
3917         * UIProcess/ProvisionalPageProxy.cpp:
3918         (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
3919         (WebKit::ProvisionalPageProxy::initializeWebPage):
3920         (WebKit::ProvisionalPageProxy::processDidFinishLaunching): Deleted.
3921         (WebKit::ProvisionalPageProxy::finishInitializingWebPageAfterProcessLaunch): Deleted.
3922         * UIProcess/ProvisionalPageProxy.h:
3923         * UIProcess/VisitedLinkStore.cpp:
3924         (WebKit::VisitedLinkStore::~VisitedLinkStore):
3925         (WebKit::VisitedLinkStore::addProcess):
3926         * UIProcess/WebPageProxy.cpp:
3927         (WebKit::WebPageProxy::finishAttachingToWebProcess):
3928         (WebKit::WebPageProxy::initializeWebPage):
3929         (WebKit::WebPageProxy::resetStateAfterProcessExited):
3930         (WebKit::WebPageProxy::finishInitializingWebPageAfterProcessLaunch): Deleted.
3931         (WebKit::WebPageProxy::processDidFinishLaunching): Deleted.
3932         * UIProcess/WebPageProxy.h:
3933         * UIProcess/WebProcessProxy.cpp:
3934         (WebKit::WebProcessProxy::shutDown):
3935         (WebKit::WebProcessProxy::removeWebPage):
3936         (WebKit::WebProcessProxy::addVisitedLinkStoreUser):
3937         (WebKit::WebProcessProxy::removeVisitedLinkStoreUser):
3938         (WebKit::WebProcessProxy::addWebUserContentControllerProxy):
3939         (WebKit::WebProcessProxy::didFinishLaunching):
3940         (WebKit::WebProcessProxy::addVisitedLinkStore): Deleted.
3941         (WebKit::WebProcessProxy::didDestroyVisitedLinkStore): Deleted.
3942         * UIProcess/WebProcessProxy.h:
3943
3944 2019-03-19  Chris Dumez  <cdumez@apple.com>
3945
3946         REGRESSION (r243094): internal media test fairplay-hls-error.html is failing
3947         https://bugs.webkit.org/show_bug.cgi?id=195954
3948         <rdar://problem/49005981>
3949
3950         Reviewed by Geoffrey Garen.
3951
3952         TestController::resetStateToConsistentValues() tries to send a "reset" message to its
3953         injected bundle. Part of the "reset" message sets the external hosts that we're allowed
3954         to load. If there is no WebProcess yet when WKPagePostMessageToInjectedBundle() is called,
3955         then this message does not get sent and the allowed hosts do not get set, causing this
3956         test failure.
3957
3958         To address the issue, make sure we launch the initial process if necessary when
3959         WebPageProxy::postMessageToInjectedBundle() is called, in order to maintain backward
3960         compatibility.
3961
3962         * UIProcess/WebPageProxy.cpp:
3963         (WebKit::WebPageProxy::postMessageToInjectedBundle):
3964
3965 2019-03-19  Chris Dumez  <cdumez@apple.com>
3966
3967         Unreviewed, rolling out r243142.
3968
3969         Caused assertion hits in WK2 Debug
3970
3971         Reverted changeset:
3972
3973         "Spew: Unhandled web process message
3974         'VisitedLinkTableController:VisitedLinkStateChanged'"
3975         https://bugs.webkit.org/show_bug.cgi?id=194787
3976         https://trac.webkit.org/changeset/243142
3977
3978 2019-03-19  Daniel Bates  <dabates@apple.com>
3979
3980         [iOS] Focus not preserved when switching between tabs
3981         https://bugs.webkit.org/show_bug.cgi?id=195820
3982         <rdar://problem/43614450>
3983
3984         Reviewed by Brent Fulgham.
3985
3986         Fixes a usability annoyance when using a hardware keyboard; focus is not preserved when switching between tabs.
3987         Do not unconditionally tell the WebProcess to blur the currently focused element when the content view (WKContentView)
3988         resigns first responder. Instead only tell