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