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