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