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