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