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