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