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