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