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