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