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