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