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