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