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