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