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