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