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