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